home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209b.zip / octave-2.09 / PATOS2.ZIP / PATCHES.OS2 < prev    next >
Text File  |  1997-08-20  |  125KB  |  4,909 lines

  1. diff -cwr g:/project/C/octave-2.09.orig/liboctave/Array2-idx.h g:/project/C/octave-2.09/liboctave/Array2-idx.h
  2. *** g:/project/C/octave-2.09.orig/liboctave/Array2-idx.h    Wed Jun 25 14:59:30 1997
  3. --- g:/project/C/octave-2.09/liboctave/Array2-idx.h    Fri Aug  1 12:51:04 1997
  4. ***************
  5. *** 226,231 ****
  6. --- 226,233 ----
  7.       resize (0, 0);
  8.         else
  9.       {
  10. +       idx_j.sort (true);
  11.         int num_to_delete = idx_j.length (nc);
  12.   
  13.         if (num_to_delete != 0)
  14. ***************
  15. *** 288,293 ****
  16. --- 290,297 ----
  17.       resize (0, 0);
  18.         else
  19.       {
  20. +       idx_i.sort (true);
  21.         int num_to_delete = idx_i.length (nr);
  22.   
  23.         if (num_to_delete != 0)
  24. diff -cwr g:/project/C/octave-2.09.orig/liboctave/CMatrix.cc g:/project/C/octave-2.09/liboctave/CMatrix.cc
  25. *** g:/project/C/octave-2.09.orig/liboctave/CMatrix.cc    Wed May 28 03:39:20 1997
  26. --- g:/project/C/octave-2.09/liboctave/CMatrix.cc    Sun Jul 27 00:29:36 1997
  27. ***************
  28. *** 1425,1430 ****
  29. --- 1425,1432 ----
  30.         else
  31.       lwork = 2*n + (nrhs > m ? nrhs : m);
  32.   
  33. +       lwork *= 16;
  34.         Array<Complex> work (lwork);
  35.         Complex *pwork = work.fortran_vec ();
  36.   
  37. ***************
  38. *** 1504,1509 ****
  39. --- 1506,1513 ----
  40.       lwork = 2*m + (nrhs > n ? nrhs : n);
  41.         else
  42.       lwork = 2*n + (nrhs > m ? nrhs : m);
  43. +       lwork *= 16;
  44.   
  45.         Array<Complex> work (lwork);
  46.         Complex *pwork = work.fortran_vec ();
  47. diff -cwr g:/project/C/octave-2.09.orig/liboctave/cmd-hist.cc g:/project/C/octave-2.09/liboctave/cmd-hist.cc
  48. *** g:/project/C/octave-2.09.orig/liboctave/cmd-hist.cc    Wed May 28 03:35:52 1997
  49. --- g:/project/C/octave-2.09/liboctave/cmd-hist.cc    Fri Mar  7 04:38:20 1997
  50. ***************
  51. *** 20,25 ****
  52. --- 20,27 ----
  53.   
  54.   */
  55.   
  56. + /* Modified by Klaus Gebhardt */
  57.   #ifdef HAVE_CONFIG_H
  58.   #include <config.h>
  59.   #endif
  60. ***************
  61. *** 119,129 ****
  62.   {
  63.     if (! ignoring_entries ())
  64.       {
  65. !       if (s.empty ()
  66. !       || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n')))
  67.       return;
  68.   
  69. !       ::add_history (s.c_str ());
  70.         lines_this_session++;
  71.       }
  72.   }
  73. --- 121,141 ----
  74.   {
  75.     if (! ignoring_entries ())
  76.       {
  77. !       if (s.empty () ||
  78. !       (s.length () == 1 && (s[0] == '\r' || s[0] == '\n' || s[0] == '')))
  79.       return;
  80.   
  81. !       string t = s;
  82. !       int l = t.length ();
  83. !       char c = t[l-2];
  84. !       if (c == '\n' || c == '\r' || c == '')
  85. !     {
  86. !       t.resize (l - 1);
  87. !       t[l-2] = '\n';
  88. !       if (l == 2)  return;
  89. !     }
  90. !       ::add_history (t.c_str ());
  91.         lines_this_session++;
  92.       }
  93.   }
  94. diff -cwr g:/project/C/octave-2.09.orig/liboctave/dMatrix.cc g:/project/C/octave-2.09/liboctave/dMatrix.cc
  95. *** g:/project/C/octave-2.09.orig/liboctave/dMatrix.cc    Wed May 28 03:39:20 1997
  96. --- g:/project/C/octave-2.09/liboctave/dMatrix.cc    Sun Jul 27 00:30:36 1997
  97. ***************
  98. *** 1156,1161 ****
  99. --- 1156,1163 ----
  100.                  ? (2*n > m ? 2*n : m)
  101.                  : (nrhs > m ? nrhs : m));
  102.   
  103. +       lwork *= 16;
  104.         Array<double> work (lwork);
  105.         double *pwork = work.fortran_vec ();
  106.   
  107. ***************
  108. *** 1256,1261 ****
  109. --- 1258,1265 ----
  110.       lwork = 3*n + (2*n > nrhs
  111.                  ? (2*n > m ? 2*n : m)
  112.                  : (nrhs > m ? nrhs : m));
  113. +       lwork *= 16;
  114.   
  115.         Array<double> work (lwork);
  116.         double *pwork = work.fortran_vec ();
  117. diff -cwr g:/project/C/octave-2.09.orig/liboctave/file-ops.cc g:/project/C/octave-2.09/liboctave/file-ops.cc
  118. *** g:/project/C/octave-2.09.orig/liboctave/file-ops.cc    Wed May 28 03:35:54 1997
  119. --- g:/project/C/octave-2.09/liboctave/file-ops.cc    Wed Aug 20 16:27:52 1997
  120. ***************
  121. *** 20,25 ****
  122. --- 20,27 ----
  123.   
  124.   */
  125.   
  126. + /* Modified by Klaus Gebhardt, 1996 */
  127.   #ifdef HAVE_CONFIG_H
  128.   #include <config.h>
  129.   #endif
  130. ***************
  131. *** 36,42 ****
  132.   #include <unistd.h>
  133.   #endif
  134.   
  135. ! #include "error.h"
  136.   #include "file-ops.h"
  137.   #include "lo-error.h"
  138.   #include "statdefs.h"
  139. --- 38,47 ----
  140.   #include <unistd.h>
  141.   #endif
  142.   
  143. ! #ifdef __EMX__
  144. ! #include <mkfifo.h>
  145. ! #endif
  146.   #include "file-ops.h"
  147.   #include "lo-error.h"
  148.   #include "statdefs.h"
  149. ***************
  150. *** 256,267 ****
  151.   int
  152.   oct_mkfifo (const string& name, mode_t mode)
  153.   {
  154. ! #if defined (HAVE_MKFIFO)
  155. !   return mkfifo (name.c_str (), mode);
  156. ! #else
  157. !   ::error ("mkfifo: not implemented on this system");
  158. !   return -1;
  159. ! #endif
  160.   }
  161.   
  162.   int
  163. --- 261,268 ----
  164.   int
  165.   oct_mkfifo (const string& name, mode_t mode)
  166.   {
  167. !   string msg;
  168. !   return oct_mkfifo (name, mode, msg);
  169.   }
  170.   
  171.   int
  172. ***************
  173. *** 277,283 ****
  174.   
  175.     return status;
  176.   #else
  177. !   ::error ("mkfifo: not implemented on this system");
  178.     return -1;
  179.   #endif
  180.   }
  181. --- 278,284 ----
  182.   
  183.     return status;
  184.   #else
  185. !   msg = "mkfifo: not implemented on this system";
  186.     return -1;
  187.   #endif
  188.   }
  189. diff -cwr g:/project/C/octave-2.09.orig/liboctave/idx-vector.cc g:/project/C/octave-2.09/liboctave/idx-vector.cc
  190. *** g:/project/C/octave-2.09.orig/liboctave/idx-vector.cc    Wed May 28 03:39:22 1997
  191. --- g:/project/C/octave-2.09/liboctave/idx-vector.cc    Fri Aug  1 12:46:00 1997
  192. ***************
  193. *** 487,492 ****
  194. --- 487,501 ----
  195.       }
  196.   
  197.     return colon_equiv;
  198. + }
  199. + void
  200. + IDX_VEC_REP::sort (bool uniq)
  201. + {
  202. +   sort_data (data, len);
  203. +   if (uniq)
  204. +     len = make_uniq (data, len);
  205.   }
  206.   
  207.   void
  208. diff -cwr g:/project/C/octave-2.09.orig/liboctave/idx-vector.h g:/project/C/octave-2.09/liboctave/idx-vector.h
  209. *** g:/project/C/octave-2.09.orig/liboctave/idx-vector.h    Wed May 28 03:39:22 1997
  210. --- g:/project/C/octave-2.09/liboctave/idx-vector.h    Fri Aug  1 12:49:00 1997
  211. ***************
  212. *** 94,99 ****
  213. --- 94,101 ----
  214.       int is_colon (void) const { return colon; }
  215.       int is_colon_equiv (int n, int sort_uniq);
  216.   
  217. +     void sort (bool uniq);
  218.       int orig_rows (void) const { return orig_nr; }
  219.       int orig_columns (void) const { return orig_nc; }
  220.   
  221. ***************
  222. *** 213,218 ****
  223. --- 215,222 ----
  224.     int is_colon (void) const { return rep->is_colon (); }
  225.     int is_colon_equiv (int n, int sort_uniq = 0) const
  226.       { return rep->is_colon_equiv (n, sort_uniq); }
  227. +   void sort (bool uniq = false) { rep->sort (uniq); }
  228.   
  229.     int orig_rows (void) const { return rep->orig_rows (); }
  230.     int orig_columns (void) const { return rep->orig_columns (); }
  231. diff -cwr g:/project/C/octave-2.09.orig/liboctave/lo-mappers.cc g:/project/C/octave-2.09/liboctave/lo-mappers.cc
  232. *** g:/project/C/octave-2.09.orig/liboctave/lo-mappers.cc    Thu Jul 10 15:57:20 1997
  233. --- g:/project/C/octave-2.09/liboctave/lo-mappers.cc    Thu Jul 10 16:19:22 1997
  234. ***************
  235. *** 20,25 ****
  236. --- 20,27 ----
  237.   
  238.   */
  239.   
  240. + /* Modified by Klaus Gebhardt, 1997 */
  241.   #ifdef HAVE_CONFIG_H
  242.   #include <config.h>
  243.   #endif
  244. ***************
  245. *** 42,49 ****
  246.   
  247.   extern "C"
  248.   {
  249. !   int F77_FCN (xdgamma, XDGAMMA) (const double&, double&);
  250.     int F77_FCN (dlgams, DLGAMS) (const double&, double&, double&);
  251.   }
  252.   
  253. --- 44,52 ----
  254.   
  255.   extern "C"
  256.   {
  257. !   double F77_FCN (derf, DERF) (const double&);
  258. !   double F77_FCN (derfc, DERFC) (const double&);
  259. !   double F77_FCN (dgamma, DGAMMA) (const double&);
  260.     int F77_FCN (dlgams, DLGAMS) (const double&, double&, double&);
  261.   }
  262.   
  263. ***************
  264. *** 130,137 ****
  265.   #if defined (HAVE_ERF)
  266.     return erf (x);
  267.   #else
  268. !   (*current_liboctave_error_handler)
  269. !     ("erf (x) not available on this system");
  270.   #endif
  271.   }
  272.   
  273. --- 133,141 ----
  274.   #if defined (HAVE_ERF)
  275.     return erf (x);
  276.   #else
  277. !   double y;
  278. !   F77_YXFCN (derf, DERF, y, (x));
  279. !   return y;
  280.   #endif
  281.   }
  282.   
  283. ***************
  284. *** 141,148 ****
  285.   #if defined (HAVE_ERFC)
  286.     return erfc (x);
  287.   #else
  288. !   (*current_liboctave_error_handler)
  289. !     ("erfc (x) not available on this system");
  290.   #endif
  291.   }
  292.   
  293. --- 145,153 ----
  294.   #if defined (HAVE_ERFC)
  295.     return erfc (x);
  296.   #else
  297. !   double y;
  298. !   F77_YXFCN (derfc, DERFC, y, (x));
  299. !   return y;
  300.   #endif
  301.   }
  302.   
  303. ***************
  304. *** 171,181 ****
  305.   double
  306.   xgamma (double x)
  307.   {
  308. !   double result;
  309. !   F77_XFCN (xdgamma, XDGAMMA, (x, result));
  310. !   return result;
  311.   }
  312.   
  313.   double
  314. --- 176,184 ----
  315.   double
  316.   xgamma (double x)
  317.   {
  318. !   double y;
  319. !   F77_YXFCN (dgamma, DGAMMA, y, (x));
  320. !   return y;
  321.   }
  322.   
  323.   double
  324. ***************
  325. *** 196,202 ****
  326.     double result;
  327.     double sgngam;
  328.   
  329. !   F77_XFCN (dlgams, DLGAMS, (x, result, sgngam));
  330.   
  331.     return result;
  332.   }
  333. --- 199,205 ----
  334.     double result;
  335.     double sgngam;
  336.   
  337. !   F77_FCN (dlgams, DLGAMS) (x, result, sgngam);
  338.   
  339.     return result;
  340.   }
  341. diff -cwr g:/project/C/octave-2.09.orig/liboctave/lo-mappers.h g:/project/C/octave-2.09/liboctave/lo-mappers.h
  342. *** g:/project/C/octave-2.09.orig/liboctave/lo-mappers.h    Wed Jun 25 16:19:20 1997
  343. --- g:/project/C/octave-2.09/liboctave/lo-mappers.h    Wed Jun 25 16:19:08 1997
  344. ***************
  345. *** 20,29 ****
  346. --- 20,33 ----
  347.   
  348.   */
  349.   
  350. + /* Modified by Klaus Gebhardt, 1997 */
  351.   #if !defined (octave_liboctave_mappers_h)
  352.   #define octave_liboctave_mappers_h 1
  353.   
  354.   #include "oct-cmplx.h"
  355. + #include "oct-math.h"
  356. + #include "lo-ieee.h"
  357.   
  358.   extern double arg (double x);
  359.   extern double conj (double x);
  360. diff -cwr g:/project/C/octave-2.09.orig/libcruft/blas/xerbla.f g:/project/C/octave-2.09/libcruft/blas/xerbla.f
  361. *** g:/project/C/octave-2.09.orig/libcruft/blas/xerbla.f    Wed May 28 03:33:48 1997
  362. --- g:/project/C/octave-2.09/libcruft/blas/xerbla.f    Mon May 26 20:26:38 1997
  363. ***************
  364. *** 33,39 ****
  365.   *
  366.         WRITE( *, FMT = 9999 )SRNAME, INFO
  367.   *
  368. !       STOP
  369.   *
  370.    9999 FORMAT( ' ** On entry to ', A6, ' parameter number ', I2, ' had ',
  371.        $      'an illegal value' )
  372. --- 33,39 ----
  373.   *
  374.         WRITE( *, FMT = 9999 )SRNAME, INFO
  375.   *
  376. !       CALL XSTOPX (' ')
  377.   *
  378.    9999 FORMAT( ' ** On entry to ', A6, ' parameter number ', I2, ' had ',
  379.        $      'an illegal value' )
  380. diff -cwr g:/project/C/octave-2.09.orig/libcruft/misc/d1mach.f g:/project/C/octave-2.09/libcruft/misc/d1mach.f
  381. *** g:/project/C/octave-2.09.orig/libcruft/misc/d1mach.f    Wed May 28 03:33:48 1997
  382. --- g:/project/C/octave-2.09/libcruft/misc/d1mach.f    Wed Aug 20 17:48:28 1997
  383. ***************
  384. *** 1,13 ****
  385.         double precision function d1mach (i)
  386.         integer i
  387. !       logical init
  388.         double precision dmach(5)
  389. !       save init, dmach
  390. !       data init /.false./
  391. !       if (.not. init) then
  392. !         call machar (dmach(1), dmach(2), dmach(3), dmach(4), dmach(5))
  393. !         init = .true.
  394. !       endif
  395.         if (i .lt. 1  .or.  i .gt. 5) goto 999
  396.         d1mach = dmach(i)
  397.         return
  398. --- 1,22 ----
  399. + * d1mach.f  Do not edit.  Generated automatically by gen-d1mach.c
  400.         double precision function d1mach(i)
  401.         integer i
  402. !       integer i1var (2)
  403. !       integer i2var (2)
  404. !       integer i3var (2)
  405. !       integer i4var (2)
  406. !       integer i5var (2)
  407.         double precision dmach(5)
  408. !       equivalence (dmach(1), i1var(1))
  409. !       equivalence (dmach(2), i2var(1))
  410. !       equivalence (dmach(3), i3var(1))
  411. !       equivalence (dmach(4), i4var(1))
  412. !       equivalence (dmach(5), i5var(1))
  413. !       data i1var(1), i1var(2) / 0 , 1048576 /
  414. !       data i2var(1), i2var(2) / -1 , 2146435071 /
  415. !       data i3var(1), i3var(2) / 0 , 1017118720 /
  416. !       data i4var(1), i4var(2) / 0 , 1018167296 /
  417. !       data i5var(1), i5var(2) / 1352628735 , 1070810131 /
  418.         if (i .lt. 1  .or.  i .gt. 5) goto 999
  419.         d1mach = dmach(i)
  420.         return
  421. diff -cwr g:/project/C/octave-2.09.orig/libcruft/misc/dostop.c g:/project/C/octave-2.09/libcruft/misc/dostop.c
  422. *** g:/project/C/octave-2.09.orig/libcruft/misc/dostop.c    Sat Feb  3 15:33:40 1996
  423. --- g:/project/C/octave-2.09/libcruft/misc/dostop.c    Sat Feb  8 15:11:04 1997
  424. ***************
  425. *** 21,26 ****
  426. --- 21,28 ----
  427.   
  428.   */
  429.   
  430. + /* Modified by Klaus Gebhardt, 1996 */
  431.   #ifdef HAVE_CONFIG_H
  432.   #include <config.h>
  433.   #endif
  434. ***************
  435. *** 30,35 ****
  436. --- 32,42 ----
  437.   
  438.   #include "f77-fcn.h"
  439.   #include "lo-error.h"
  440. + #ifdef __EMX__
  441. + int f77_exception_encountered;
  442. + jmp_buf f77_context;
  443. + #endif
  444.   
  445.   /* All the STOP statements in the Fortran routines have been replaced
  446.      with a call to XSTOPX, defined in the file libcruft/misc/xstopx.f.
  447. diff -cwr g:/project/C/octave-2.09.orig/libcruft/misc/f77-fcn.h g:/project/C/octave-2.09/libcruft/misc/f77-fcn.h
  448. *** g:/project/C/octave-2.09.orig/libcruft/misc/f77-fcn.h    Sun Mar  3 02:16:14 1996
  449. --- g:/project/C/octave-2.09/libcruft/misc/f77-fcn.h    Sat Feb  8 15:41:26 1997
  450. ***************
  451. *** 20,25 ****
  452. --- 20,27 ----
  453.   
  454.   */
  455.   
  456. + /* Modified by Klaus Gebhardt, 1997 */
  457.   #if !defined (octave_f77_fcn_h)
  458.   #define octave_f77_fcn_h 1
  459.   
  460. ***************
  461. *** 77,82 ****
  462. --- 79,103 ----
  463.       } \
  464.         else \
  465.       F77_FCN (f, F) args; \
  466. +       copy_f77_context ((char *) saved_f77_context, (char *) f77_context, \
  467. +             sizeof (jmp_buf)); \
  468. +     } \
  469. +   while (0)
  470. + #define F77_YXFCN(f, F, rc, args) \
  471. +   do \
  472. +     { \
  473. +       jmp_buf saved_f77_context; \
  474. +       f77_exception_encountered = 0; \
  475. +       copy_f77_context ((char *) f77_context, (char *) saved_f77_context, \
  476. +             sizeof (jmp_buf)); \
  477. +       if (setjmp (f77_context)) \
  478. +     { \
  479. +       f77_exception_encountered = 1; \
  480. +       F77_XFCN_ERROR (f, F); \
  481. +     } \
  482. +       else \
  483. +     rc = F77_FCN (f, F) args; \
  484.         copy_f77_context ((char *) saved_f77_context, (char *) f77_context, \
  485.               sizeof (jmp_buf)); \
  486.       } \
  487. diff -cwr g:/project/C/octave-2.09.orig/src/defaults.cc g:/project/C/octave-2.09/src/defaults.cc
  488. *** g:/project/C/octave-2.09.orig/src/defaults.cc    Thu Jul 10 15:57:22 1997
  489. --- g:/project/C/octave-2.09/src/defaults.cc    Wed Aug 13 14:55:10 1997
  490. ***************
  491. *** 28,33 ****
  492. --- 28,35 ----
  493.   
  494.   */
  495.   
  496. + /* Modified by Klaus Gebhardt, 1996 - 1997 */
  497.   #ifdef HAVE_CONFIG_H
  498.   #include <config.h>
  499.   #endif
  500. ***************
  501. *** 160,166 ****
  502.   
  503.         if (shell_path)
  504.       {
  505. !       Vexec_path = string (":");
  506.         Vexec_path.append (shell_path);
  507.       }
  508.       }
  509. --- 162,168 ----
  510.   
  511.         if (shell_path)
  512.       {
  513. !       Vexec_path = string (SEPCHAR_STR);
  514.         Vexec_path.append (shell_path);
  515.       }
  516.       }
  517. ***************
  518. *** 200,214 ****
  519. --- 202,224 ----
  520.       Vinfo_prog = string (oct_info_prog);
  521.     else
  522.       {
  523. + #if !defined (__EMX__)
  524.         Vinfo_prog = Varch_lib_dir;
  525.         Vinfo_prog.append ("/info");
  526. + #else
  527. +       Vinfo_prog = "";
  528. + #endif
  529.       }
  530.   }
  531.   
  532.   static void
  533.   set_default_editor (void)
  534.   {
  535. + #if defined (__EMX__) && defined (OS2)
  536. +   Veditor = "e";
  537. + #else
  538.     Veditor = "emacs";
  539. + #endif
  540.   
  541.     char *env_editor = getenv ("EDITOR");
  542.   
  543. ***************
  544. *** 338,345 ****
  545.   
  546.         if (eplen > 0)
  547.       {
  548. !       int prepend = (Vexec_path[0] == ':');
  549. !       int append = (eplen > 1 && Vexec_path[eplen-1] == ':');
  550.   
  551.         if (prepend)
  552.           {
  553. --- 348,355 ----
  554.   
  555.         if (eplen > 0)
  556.       {
  557. !       int prepend = (Vexec_path[0] == SEPCHAR);
  558. !       int append = (eplen > 1 && Vexec_path[eplen-1] == SEPCHAR);
  559.   
  560.         if (prepend)
  561.           {
  562. diff -cwr g:/project/C/octave-2.09.orig/src/file-io.cc g:/project/C/octave-2.09/src/file-io.cc
  563. *** g:/project/C/octave-2.09.orig/src/file-io.cc    Wed May 28 03:39:28 1997
  564. --- g:/project/C/octave-2.09/src/file-io.cc    Wed May 28 03:03:18 1997
  565. ***************
  566. *** 34,39 ****
  567. --- 34,41 ----
  568.   // Completely rewritten by John W. Eaton <jwe@bevo.che.wisc.edu>,
  569.   // April 1996.
  570.   
  571. + /* Modified by Klaus Gebhardt, 1997 */
  572.   #ifdef HAVE_CONFIG_H
  573.   #include <config.h>
  574.   #endif
  575. ***************
  576. *** 62,67 ****
  577. --- 64,70 ----
  578.   #include "oct-stream.h"
  579.   #include "oct-strstrm.h"
  580.   #include "pager.h"
  581. + #include "sighandlers.h"
  582.   #include "sysdep.h"
  583.   #include "utils.h"
  584.   #include "variables.h"
  585. ***************
  586. *** 1282,1287 ****
  587. --- 1285,1325 ----
  588.   }
  589.   
  590.   DEFALIAS (octave_tmp_file_name, tmpnam);
  591. + DEFUN (child_purge_temp, args, ,
  592. +  "child_purge_temp (pid, name)\n\
  593. + Remove the file NAME, when child PID dies.")
  594. + {
  595. +   octave_value retval = -1.0;
  596. +   if (args.length () == 2)
  597. +     {
  598. +       if (args(1).is_string ())
  599. +     {
  600. +       double d_pid = args(0).double_value ();
  601. +       string name  = args(1).string_value ();
  602. +       if (!error_state)
  603. +         {
  604. +           if (D_NINT (d_pid) == d_pid)
  605. +         {
  606. +           int i_pid = NINT (d_pid);
  607. +           octave_child_list::insert (i_pid, 0, name);
  608. +           retval = 0.0;
  609. +         }
  610. +           else
  611. +         error ("child_purge_temp: pid must be an integer");
  612. +         }
  613. +     }
  614. +       else
  615. +     error ("child_purge_temp: second argument must be a string");
  616. +     }
  617. +   else
  618. +     print_usage ("child_purge_temp");
  619. +   return retval;
  620. + }
  621.   
  622.   static int
  623.   convert (int x, int ibase, int obase)
  624. diff -cwr g:/project/C/octave-2.09.orig/src/help.cc g:/project/C/octave-2.09/src/help.cc
  625. *** g:/project/C/octave-2.09.orig/src/help.cc    Wed May 28 03:36:46 1997
  626. --- g:/project/C/octave-2.09/src/help.cc    Thu Aug 14 17:06:18 1997
  627. ***************
  628. *** 20,25 ****
  629. --- 20,27 ----
  630.   
  631.   */
  632.   
  633. + /* Modified by Klaus Gebhardt, 1996 */
  634.   #ifdef HAVE_CONFIG_H
  635.   #include <config.h>
  636.   #endif
  637. ***************
  638. *** 65,70 ****
  639. --- 67,87 ----
  640.   #include "utils.h"
  641.   #include "variables.h"
  642.   
  643. + #if defined (__EMX__)
  644. + extern "C"
  645. + {
  646. + #include "info/info.h"
  647. + #include "info/dribble.h"
  648. + #include "info/terminal.h"
  649. +   extern int external_info_search ();
  650. +   extern int index_entry_exists ();
  651. +   extern int do_info_index_search ();
  652. +   extern void finish_info_session ();
  653. +   extern char *replace_in_documentation ();
  654. + }
  655. + #endif
  656.   // Name of the info file specified on command line.
  657.   // (--info-file file)
  658.   string Vinfo_file;
  659. ***************
  660. *** 526,531 ****
  661. --- 543,550 ----
  662.   static int
  663.   try_info (const string& nm)
  664.   {
  665. +   if (Vinfo_prog.length () > 0)
  666. +     {
  667.         int status = 0;
  668.   
  669.         static char *cmd_str = 0;
  670. ***************
  671. *** 567,578 ****
  672.   
  673.     return status;
  674.   }
  675.   
  676.   static void
  677.   help_from_info (const string_vector& argv, int idx, int argc)
  678.   {
  679.     if (idx == argc)
  680. !     try_info (string ());
  681.     else
  682.       {
  683.         for (int i = idx; i < argc; i++)
  684. --- 586,662 ----
  685.   
  686.         return status;
  687.       }
  688. +   else
  689. +     {
  690. +       volatile octave_interrupt_handler old_interrupt_handler
  691. +     = octave_ignore_interrupts ();
  692. +       int status = 0;
  693. +       char *directory_name = strdup (Vinfo_file.c_str ());
  694. +       char *temp = filename_non_directory (directory_name);
  695. +       if (temp != directory_name)
  696. +     {
  697. +       *temp = 0;
  698. +       info_add_path (directory_name, INFOPATH_PREPEND);
  699. +     }
  700. +       delete [] directory_name;
  701. +       NODE *initial_node = info_get_node (Vinfo_file.c_str (), 0);
  702. +       if (! initial_node)  status = 127;
  703. +       else
  704. +     {
  705. +       status = external_info_search(initial_node, 0,
  706. +                     Vinfo_file.c_str (), nm.c_str ());
  707. +       if (status == 1)
  708. +         {
  709. +           char *format = replace_in_documentation
  710. +         ("Type \"\\[quit]\" to quit, \"\\[get-help-window]\" for help.");
  711. +           window_message_in_echo_area (format);
  712. +           info_read_and_dispatch ();
  713. + #ifdef __EMX__
  714. +           terminal_goto_xy (0, screenheight - 2);
  715. + #else
  716. +           terminal_goto_xy (0, screenheight - 1);
  717. + #endif
  718. +           terminal_clear_to_eol ();
  719. +           terminal_unprep_terminal ();
  720. +         }
  721. +       status = status * status - 1;
  722. +       finish_info_session (initial_node, 0);
  723. +     }
  724. +       octave_set_interrupt_handler (old_interrupt_handler);
  725. +       return status;
  726. +     }
  727. + }
  728.   
  729.   static void
  730.   help_from_info (const string_vector& argv, int idx, int argc)
  731.   {
  732.     if (idx == argc)
  733. !     {
  734. !       int status = try_info (string ());
  735. !       if (status)
  736. !     {
  737. !       if (status < 0)
  738. !         {
  739. !           message ("help", "sorry, `%s' is not indexed in the manual",
  740. !                string ().c_str ());
  741. !           sleep (2);
  742. !         }
  743. !       else  error ("help: unable to find info!");
  744. !     }
  745. !     }
  746.     else
  747.       {
  748.         for (int i = idx; i < argc; i++)
  749. ***************
  750. *** 983,988 ****
  751. --- 1067,1073 ----
  752.   
  753.     string s = builtin_string_variable ("INFO_PROGRAM");
  754.   
  755. + #ifndef __EMX__
  756.     if (s.empty ())
  757.       {
  758.         gripe_invalid_value_specified ("INFO_PROGRAM");
  759. ***************
  760. *** 990,995 ****
  761. --- 1075,1083 ----
  762.       }
  763.     else
  764.       Vinfo_prog = s;
  765. + #else
  766. +   Vinfo_prog = s;
  767. + #endif
  768.   
  769.     return status;
  770.   }
  771. diff -cwr g:/project/C/octave-2.09.orig/src/input.cc g:/project/C/octave-2.09/src/input.cc
  772. *** g:/project/C/octave-2.09.orig/src/input.cc    Wed May 28 03:39:28 1997
  773. --- g:/project/C/octave-2.09/src/input.cc    Wed May 28 04:14:42 1997
  774. ***************
  775. *** 30,35 ****
  776. --- 30,37 ----
  777.   
  778.   */
  779.   
  780. + /* Modified by Klaus Gebhardt, 1996 */
  781.   // Use the GNU readline library for command line editing and hisory.
  782.   
  783.   #ifdef HAVE_CONFIG_H
  784. ***************
  785. *** 120,125 ****
  786. --- 122,131 ----
  787.   // Nonzero means the user forced this shell to be interactive (-i).
  788.   int forced_interactive = 0;
  789.   
  790. + // Nonzero means the user forced this shell to be really interactive (-i),
  791. + // but without using the pager.
  792. + int really_forced_interactive = 0;
  793.   // Should we issue a prompt?
  794.   int promptflag = 1;
  795.   
  796. ***************
  797. *** 429,435 ****
  798.       }
  799.     else
  800.       {
  801. !       if (s && *s && (interactive || forced_interactive))
  802.       {
  803.         fprintf (rl_outstream, s);
  804.         fflush (rl_outstream);
  805. --- 435,442 ----
  806.       }
  807.     else
  808.       {
  809. !       if (s && *s &&
  810. !       (interactive || forced_interactive || really_forced_interactive))
  811.       {
  812.         fprintf (rl_outstream, s);
  813.         fflush (rl_outstream);
  814. ***************
  815. *** 494,500 ****
  816.   {
  817.     char *retval = 0;
  818.   
  819. !   if ((interactive || forced_interactive)
  820.         && (! (reading_fcn_file || reading_script_file)))
  821.       {
  822.         const char *ps = (promptflag > 0) ? Vps1.c_str () :
  823. --- 501,507 ----
  824.   {
  825.     char *retval = 0;
  826.   
  827. !   if ((interactive || forced_interactive || really_forced_interactive)
  828.         && (! (reading_fcn_file || reading_script_file)))
  829.       {
  830.         const char *ps = (promptflag > 0) ? Vps1.c_str () :
  831. ***************
  832. *** 637,643 ****
  833.     FILE *instream = 0;
  834.   
  835.     if (name.length () > 0)
  836. !     instream = fopen (name.c_str (), "r");
  837.   
  838.     if (! instream && warn)
  839.       warning ("%s: no such file or directory", name.c_str ());
  840. --- 644,650 ----
  841.     FILE *instream = 0;
  842.   
  843.     if (name.length () > 0)
  844. !     instream = fopen (name.c_str (), "rb");
  845.   
  846.     if (! instream && warn)
  847.       warning ("%s: no such file or directory", name.c_str ());
  848. diff -cwr g:/project/C/octave-2.09.orig/src/input.h g:/project/C/octave-2.09/src/input.h
  849. *** g:/project/C/octave-2.09.orig/src/input.h    Sun Jun 23 04:45:44 1996
  850. --- g:/project/C/octave-2.09/src/input.h    Wed Dec 11 05:26:08 1996
  851. ***************
  852. *** 20,25 ****
  853. --- 20,27 ----
  854.   
  855.   */
  856.   
  857. + /* Modified by Klaus Gebhardt, 1996 */
  858.   // Use the GNU readline library for command line editing and hisory.
  859.   
  860.   #if !defined (octave_input_h)
  861. ***************
  862. *** 60,65 ****
  863. --- 62,71 ----
  864.   
  865.   // Nonzero means the user forced this shell to be interactive (-i).
  866.   extern int forced_interactive;
  867. + // Nonzero means the user forced this shell to be really interactive (-i),
  868. + // but without using the pager.
  869. + extern int really_forced_interactive;
  870.   
  871.   // Should we issue a prompt?
  872.   extern int promptflag;
  873. diff -cwr g:/project/C/octave-2.09.orig/src/lex.l g:/project/C/octave-2.09/src/lex.l
  874. *** g:/project/C/octave-2.09.orig/src/lex.l    Wed May 28 03:39:28 1997
  875. --- g:/project/C/octave-2.09/src/lex.l    Mon May 26 19:10:56 1997
  876. ***************
  877. *** 20,25 ****
  878. --- 20,27 ----
  879.   
  880.   */
  881.   
  882. + /* Modified by Klaus Gebhardt, 1996 */
  883.   %s TEXT_FCN
  884.   %s MATRIX
  885.   
  886. ***************
  887. *** 191,197 ****
  888.   
  889.   D    [0-9]
  890.   S    [ \t]
  891. ! NL    ((\n)|(\r\n))
  892.   SNL    ({S}|{NL})
  893.   EL    (\.\.\.)
  894.   BS    (\\)
  895. --- 193,199 ----
  896.   
  897.   D    [0-9]
  898.   S    [ \t]
  899. ! NL    ((\n)|(\r)|(\r\n)|())
  900.   SNL    ({S}|{NL})
  901.   EL    (\.\.\.)
  902.   BS    (\\)
  903. ***************
  904. *** 244,250 ****
  905.       return handle_string (yytext[0], 1);
  906.     }
  907.   
  908. ! <TEXT_FCN>[^ \t\n\;\,]*{S}* {
  909.       string tok = strip_trailing_whitespace (yytext);
  910.       TOK_PUSH_AND_RETURN (tok, TEXT);
  911.     }
  912. --- 246,252 ----
  913.       return handle_string (yytext[0], 1);
  914.     }
  915.   
  916. ! <TEXT_FCN>[^ \t\r\n\;\,]*{S}* {
  917.       string tok = strip_trailing_whitespace (yytext);
  918.       TOK_PUSH_AND_RETURN (tok, TEXT);
  919.     }
  920. ***************
  921. *** 540,546 ****
  922.       else
  923.         {
  924.       int c;
  925. !     while ((c = yyinput ()) != EOF && c != '\n')
  926.         ; // Eat comment.
  927.         }
  928.   
  929. --- 542,548 ----
  930.       else
  931.         {
  932.       int c;
  933. !     while ((c = yyinput ()) != EOF && c != '\n' && c != '\r' && c != '')
  934.         ; // Eat comment.
  935.         }
  936.   
  937. ***************
  938. *** 690,696 ****
  939.   
  940.     // Only ask for input from stdin if we are expecting interactive
  941.     // input.
  942. !   if (interactive && ! (reading_fcn_file || get_input_from_eval_string))
  943.       yyrestart (stdin);
  944.   
  945.     // Clear the buffer for help text.
  946. --- 692,699 ----
  947.   
  948.     // Only ask for input from stdin if we are expecting interactive
  949.     // input.
  950. !   if ((interactive || really_forced_interactive) &&
  951. !       ! (reading_fcn_file || get_input_from_eval_string))
  952.       yyrestart (stdin);
  953.   
  954.     // Clear the buffer for help text.
  955. ***************
  956. *** 781,787 ****
  957.     char c;
  958.     while ((c = *s++) != '\0')
  959.       {
  960. !       if (c == '\n')
  961.         current_input_column = 1;
  962.         else
  963.       current_input_column++;
  964. --- 784,790 ----
  965.     char c;
  966.     while ((c = *s++) != '\0')
  967.       {
  968. !       if (c == '\n' || c == '\r' || c == '')
  969.         current_input_column = 1;
  970.         else
  971.       current_input_column++;
  972. ***************
  973. *** 1111,1117 ****
  974.   
  975.     bool begin_comment = true;
  976.     bool in_comment = true;
  977. !   int c = 0;
  978.   
  979.     while ((c = yyinput ()) != EOF)
  980.       {
  981. --- 1114,1120 ----
  982.   
  983.     bool begin_comment = true;
  984.     bool in_comment = true;
  985. !   int c = 0, d, ct;
  986.   
  987.     while ((c = yyinput ()) != EOF)
  988.       {
  989. ***************
  990. *** 1125,1136 ****
  991.   
  992.         if (in_comment)
  993.       {
  994. !       help_buf += (char) c;
  995.   
  996. -       if (c == '\n')
  997.           in_comment = false;
  998.       }
  999.         else
  1000.       {
  1001.         switch (c)
  1002.           {
  1003. --- 1128,1157 ----
  1004.   
  1005.         if (in_comment)
  1006.       {
  1007. !       if (c == '\n' || c == '\r' || c == '')
  1008. !         {
  1009. !           ct = 0;
  1010. !           d  = c;
  1011. !           do
  1012. !         {
  1013. !           if (d == '\n' || d == '')
  1014. !             {
  1015. !               if (++ct > 1)  break;
  1016. !               help_buf += (char) '\n';
  1017. !             }
  1018. !         }
  1019. !           while (((d = yyinput ()) != EOF) &&
  1020. !              (d == '\n' || d == '\r' || d == ''));
  1021. !           if (d != EOF)  yyunput (d, yytext);
  1022.   
  1023.             in_comment = false;
  1024.           }
  1025.         else
  1026. +         help_buf += (char) c;
  1027. +     }
  1028. +       else
  1029.       {
  1030.         switch (c)
  1031.           {
  1032. ***************
  1033. *** 1317,1322 ****
  1034. --- 1338,1345 ----
  1035.         retval |= ATE_SPACE_OR_TAB;
  1036.         break;
  1037.   
  1038. +     case '':
  1039. +     case '\r':
  1040.       case '\n':
  1041.         retval |= ATE_NEWLINE;
  1042.         in_comment = 0;
  1043. ***************
  1044. *** 1434,1439 ****
  1045. --- 1457,1464 ----
  1046.           goto cleanup;
  1047.         break;
  1048.   
  1049. +     case '':
  1050. +     case '\r':
  1051.       case '\n':
  1052.         current_input_column = 0;
  1053.         promptflag--;
  1054. ***************
  1055. *** 1542,1548 ****
  1056.         if (! have_ellipsis_continuation (0))
  1057.           buf << (char) c;
  1058.       }
  1059. !       else if (c == '\n')
  1060.       {
  1061.         error ("unterminated string constant");
  1062.         break;
  1063. --- 1567,1573 ----
  1064.         if (! have_ellipsis_continuation (0))
  1065.           buf << (char) c;
  1066.       }
  1067. !       else if (c == '\n' || c == '\r' || c == '')
  1068.       {
  1069.         error ("unterminated string constant");
  1070.         break;
  1071. ***************
  1072. *** 1640,1646 ****
  1073.         int postfix_un_op = next_token_is_postfix_unary_op
  1074.           (spc_gobbled, yytext);
  1075.   
  1076. !       int other_op = match_any (c1, ",;\n]");
  1077.   
  1078.         if (! (postfix_un_op || bin_op || other_op)
  1079.             && nesting_level.is_brace ()
  1080. --- 1665,1671 ----
  1081.         int postfix_un_op = next_token_is_postfix_unary_op
  1082.           (spc_gobbled, yytext);
  1083.   
  1084. !       int other_op = match_any (c1, ",;\n\r]");
  1085.   
  1086.         if (! (postfix_un_op || bin_op || other_op)
  1087.             && nesting_level.is_brace ()
  1088. ***************
  1089. *** 1673,1679 ****
  1090.         int c2 = yyinput ();
  1091.         unput (c2);
  1092.         unput (c1);
  1093. !       int sep_op = match_any (c1, ",;\n]");
  1094.         int dot_op = (c1 == '.'
  1095.               && (isalpha (c2) || isspace (c2) || c2 == '_'));
  1096.         int index_op = (c1 == '('
  1097. --- 1698,1704 ----
  1098.         int c2 = yyinput ();
  1099.         unput (c2);
  1100.         unput (c1);
  1101. !       int sep_op = match_any (c1, ",;\n\r]");
  1102.         int dot_op = (c1 == '.'
  1103.               && (isalpha (c2) || isspace (c2) || c2 == '_'));
  1104.         int index_op = (c1 == '('
  1105. ***************
  1106. *** 1866,1871 ****
  1107. --- 1891,1898 ----
  1108.       case ',':
  1109.         break;
  1110.   
  1111. +     case '':
  1112. +     case '\r':
  1113.       case '\n':
  1114.         if (in_comment)
  1115.           in_comment = 0;
  1116. diff -cwr g:/project/C/octave-2.09.orig/src/mappers.cc g:/project/C/octave-2.09/src/mappers.cc
  1117. *** g:/project/C/octave-2.09.orig/src/mappers.cc    Thu Jun  5 03:13:30 1997
  1118. --- g:/project/C/octave-2.09/src/mappers.cc    Wed Jun 25 16:16:48 1997
  1119. ***************
  1120. *** 20,33 ****
  1121.   
  1122.   */
  1123.   
  1124.   #ifdef HAVE_CONFIG_H
  1125.   #include <config.h>
  1126.   #endif
  1127.   
  1128.   #include <cctype>
  1129.   #include <cfloat>
  1130. - #include "lo-mappers.h"
  1131.   
  1132.   #include "defun.h"
  1133.   #include "error.h"
  1134. --- 20,33 ----
  1135.   
  1136.   */
  1137.   
  1138. + /* Modified by Klaus Gebhardt, 1997 */
  1139.   #ifdef HAVE_CONFIG_H
  1140.   #include <config.h>
  1141.   #endif
  1142.   
  1143.   #include <cctype>
  1144.   #include <cfloat>
  1145.   
  1146.   #include "defun.h"
  1147.   #include "error.h"
  1148. diff -cwr g:/project/C/octave-2.09.orig/src/mappers.h g:/project/C/octave-2.09/src/mappers.h
  1149. *** g:/project/C/octave-2.09.orig/src/mappers.h    Fri May 24 05:08:38 1996
  1150. --- g:/project/C/octave-2.09/src/mappers.h    Wed Jun 25 16:17:02 1997
  1151. ***************
  1152. *** 20,32 ****
  1153.   
  1154.   */
  1155.   
  1156.   #if !defined (octave_mappers_h)
  1157.   #define octave_mappers_h 1
  1158.   
  1159.   #include <string>
  1160.   
  1161.   #include "lo-mappers.h"
  1162. - #include "oct-cmplx.h"
  1163.   
  1164.   typedef int (*ch_Mapper)(int);
  1165.   typedef double (*d_d_Mapper)(double);
  1166. --- 20,33 ----
  1167.   
  1168.   */
  1169.   
  1170. + /* Modified by Klaus Gebhardt, 1997 */
  1171.   #if !defined (octave_mappers_h)
  1172.   #define octave_mappers_h 1
  1173.   
  1174.   #include <string>
  1175.   
  1176.   #include "lo-mappers.h"
  1177.   
  1178.   typedef int (*ch_Mapper)(int);
  1179.   typedef double (*d_d_Mapper)(double);
  1180. diff -cwr g:/project/C/octave-2.09.orig/src/oct-hist.cc g:/project/C/octave-2.09/src/oct-hist.cc
  1181. *** g:/project/C/octave-2.09.orig/src/oct-hist.cc    Wed May 28 03:36:46 1997
  1182. --- g:/project/C/octave-2.09/src/oct-hist.cc    Sat Mar 15 18:35:44 1997
  1183. ***************
  1184. *** 27,32 ****
  1185. --- 27,34 ----
  1186.   
  1187.   */
  1188.   
  1189. + /* Modified by Klaus Gebhardt, 1996 */
  1190.   #ifdef HAVE_CONFIG_H
  1191.   #include <config.h>
  1192.   #endif
  1193. ***************
  1194. *** 64,69 ****
  1195. --- 66,79 ----
  1196.   #include "utils.h"
  1197.   #include "variables.h"
  1198.   
  1199. + #ifdef __EMX__
  1200. + extern "C"
  1201. + {
  1202. + #include <process.h>
  1203. +   int _IO_system (const char *, int);
  1204. + }
  1205. + #endif
  1206.   // Nonzero means input is coming from temporary history file.
  1207.   int input_from_tmp_history_file = 0;
  1208.   
  1209. ***************
  1210. *** 283,289 ****
  1211.   
  1212.             int cmd_len = cmd.length ();
  1213.   
  1214. !           if (cmd[cmd_len - 1] == '\n')
  1215.           cmd.resize (cmd_len - 1);
  1216.   
  1217.             if (! cmd.empty ())
  1218. --- 293,300 ----
  1219.   
  1220.             int cmd_len = cmd.length ();
  1221.   
  1222. !           if (cmd[cmd_len - 1] == '\n' || cmd[cmd_len - 1] == '\r'
  1223. !           || cmd[cmd_len - 1] == '')
  1224.           cmd.resize (cmd_len - 1);
  1225.   
  1226.             if (! cmd.empty ())
  1227. ***************
  1228. *** 302,308 ****
  1229.   
  1230.         int len = tmp.length ();
  1231.       
  1232. !       if (len > 0 && tmp[len-1] == '\n')
  1233.       tmp.resize (len - 1);
  1234.   
  1235.         if (! tmp.empty ())
  1236. --- 313,320 ----
  1237.   
  1238.         int len = tmp.length ();
  1239.       
  1240. !       if (len > 0 &&
  1241. !       (tmp[len-1] == '\n' || tmp[len-1] == '\r' || tmp[len-1] == ''))
  1242.       tmp.resize (len - 1);
  1243.   
  1244.         if (! tmp.empty ())
  1245. ***************
  1246. *** 430,436 ****
  1247. --- 442,452 ----
  1248.     volatile octave_interrupt_handler old_interrupt_handler
  1249.       = octave_ignore_interrupts ();
  1250.   
  1251. + #ifdef __EMX__
  1252. +   _IO_system (cmd.c_str (), P_WAIT);
  1253. + #else
  1254.     system (cmd.c_str ());
  1255. + #endif
  1256.   
  1257.     octave_set_interrupt_handler (old_interrupt_handler);
  1258.   
  1259. diff -cwr g:/project/C/octave-2.09.orig/src/octave.cc g:/project/C/octave-2.09/src/octave.cc
  1260. *** g:/project/C/octave-2.09.orig/src/octave.cc    Wed May 28 03:39:28 1997
  1261. --- g:/project/C/octave-2.09/src/octave.cc    Mon May 26 18:12:16 1997
  1262. ***************
  1263. *** 22,27 ****
  1264. --- 22,29 ----
  1265.   
  1266.   // Born February 20, 1992.
  1267.   
  1268. + /* Modified by Klaus Gebhardt, 1996 */
  1269.   #ifdef HAVE_CONFIG_H
  1270.   #include <config.h>
  1271.   #endif
  1272. ***************
  1273. *** 47,52 ****
  1274. --- 49,59 ----
  1275.   #include <pwd.h>
  1276.   #endif
  1277.   
  1278. + #ifdef __EMX__
  1279. + #include <float.h>
  1280. + #include <sys/uflags.h>
  1281. + #endif
  1282.   #include "lo-error.h"
  1283.   #include "str-vec.h"
  1284.   
  1285. ***************
  1286. *** 121,127 ****
  1287.   
  1288.   // Usage message
  1289.   static const char *usage_string = 
  1290. !   "octave [-?Vdfhiqvx] [--debug] [--echo-commands] [--exec-path path]\n\
  1291.          [--help] [--info-file file] [--info-program prog] [--interactive]\n\
  1292.          [--no-init-file] [--no-line-editing] [--no-site-file] [-p path]\n\
  1293.          [--path path] [--silent] [--traditional] [--verbose] [--version] [file]";
  1294. --- 128,134 ----
  1295.   
  1296.   // Usage message
  1297.   static const char *usage_string = 
  1298. !   "octave [-?VdfhiIqvx] [--debug] [--echo-commands] [--exec-path path]\n\
  1299.          [--help] [--info-file file] [--info-program prog] [--interactive]\n\
  1300.          [--no-init-file] [--no-line-editing] [--no-site-file] [-p path]\n\
  1301.          [--path path] [--silent] [--traditional] [--verbose] [--version] [file]";
  1302. ***************
  1303. *** 129,135 ****
  1304.   // This is here so that it's more likely that the usage message and
  1305.   // the real set of options will agree.  Note: the `+' must come first
  1306.   // to prevent getopt from permuting arguments!
  1307. ! static const char *short_opts = "+?Vdfhip:qvx";
  1308.   
  1309.   // Long options.  See the comments in getopt.h for the meanings of the
  1310.   // fields in this structure.
  1311. --- 136,142 ----
  1312.   // This is here so that it's more likely that the usage message and
  1313.   // the real set of options will agree.  Note: the `+' must come first
  1314.   // to prevent getopt from permuting arguments!
  1315. ! static const char *short_opts = "+?VdfhiIp:qvx";
  1316.   
  1317.   // Long options.  See the comments in getopt.h for the meanings of the
  1318.   // fields in this structure.
  1319. ***************
  1320. *** 326,331 ****
  1321. --- 333,339 ----
  1322.     --info-file FILE        Use top-level info file FILE.\n\
  1323.     --info-program PROGRAM  Use PROGRAM for reading info files.\n\
  1324.     -i, --interactive       Force interactive behavior.\n\
  1325. +   -I                      Force really interactive behavior, but no pager.\n\
  1326.     --no-init-file          Don't read the ~/.octaverc or .octaverc files.\n\
  1327.     --no-line-editing       Don't use readline for command-line editing.\n\
  1328.     --no-site-file          Don't read the site-wide octaverc file.\n\
  1329. ***************
  1330. *** 452,457 ****
  1331. --- 460,469 ----
  1332.         forced_interactive = 1;
  1333.         break;
  1334.   
  1335. +     case 'I':
  1336. +       really_forced_interactive = 1;
  1337. +       break;
  1338.       case 'p':
  1339.         if (args.optarg ())
  1340.           bind_builtin_variable ("LOADPATH", args.optarg ());
  1341. ***************
  1342. *** 539,544 ****
  1343. --- 551,563 ----
  1344.     if (! inhibit_startup_message && reading_startup_message_printed)
  1345.       cout << endl;
  1346.   
  1347. + #if defined (__EMX__)
  1348. +   _control87 (EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW |
  1349. +           EM_UNDERFLOW | EM_INEXACT, MCW_EM);
  1350. +   _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
  1351. + #endif
  1352.     // Avoid counting commands executed from startup files.
  1353.   
  1354.     current_command_number = 1;
  1355. ***************
  1356. *** 594,610 ****
  1357.     // Force input to be echoed if not really interactive, but the user
  1358.     // has forced interactive behavior.
  1359.   
  1360. !   if (! interactive && forced_interactive)
  1361.       {
  1362.         rl_blink_matching_paren = 0;
  1363.   
  1364.         // XXX FIXME XXX -- is this the right thing to do?
  1365.   
  1366.         bind_builtin_variable ("echo_executing_commands",
  1367.                    (double) ECHO_CMD_LINE);
  1368.       }
  1369.   
  1370. !   if (! interactive)
  1371.       using_readline = 0;
  1372.   
  1373.     int retval = main_loop ();
  1374. --- 613,631 ----
  1375.     // Force input to be echoed if not really interactive, but the user
  1376.     // has forced interactive behavior.
  1377.   
  1378. !   if (! interactive && (forced_interactive || really_forced_interactive))
  1379.       {
  1380.         rl_blink_matching_paren = 0;
  1381.   
  1382.         // XXX FIXME XXX -- is this the right thing to do?
  1383.   
  1384. + #if ! defined (__EMX__)
  1385.         bind_builtin_variable ("echo_executing_commands",
  1386.                    (double) ECHO_CMD_LINE);
  1387. + #endif
  1388.       }
  1389.   
  1390. !   if (! (interactive || really_forced_interactive))
  1391.       using_readline = 0;
  1392.   
  1393.     int retval = main_loop ();
  1394. diff -cwr g:/project/C/octave-2.09.orig/src/op-str-str.cc g:/project/C/octave-2.09/src/op-str-str.cc
  1395. *** g:/project/C/octave-2.09.orig/src/op-str-str.cc    Wed May 28 03:34:04 1997
  1396. --- g:/project/C/octave-2.09/src/op-str-str.cc    Wed Jan 29 05:16:18 1997
  1397. ***************
  1398. *** 20,25 ****
  1399. --- 20,27 ----
  1400.   
  1401.   */
  1402.   
  1403. + /* Modified by Klaus Gebhardt, 1997 */
  1404.   #if defined (__GNUG__)
  1405.   #pragma implementation
  1406.   #endif
  1407. ***************
  1408. *** 50,69 ****
  1409.         if (cm2.rows () == 1 && cm2.columns () == 1)
  1410.       return octave_value (cm1 (0, 0) == cm2 (0, 0));
  1411.         else
  1412. !     SC_MX_BOOL_OP (char, c, cm1 (0, 0), charMatrix, m, cm2,
  1413.                  c == m (i, j), 0.0);
  1414.       }
  1415.     else
  1416.       {
  1417. !       int cm2_nr = cm2.rows ();
  1418. !       int cm2_nc = cm2.cols ();
  1419. !       if (cm2_nr == 1 && cm2_nc == 1)
  1420. !     MX_SC_BOOL_OP (charMatrix, m, cm1, char, c, cm2 (0, 0),
  1421.                  c == m (i, j), 0.0);
  1422.         else
  1423. !     MX_MX_BOOL_OP (charMatrix, m1, cm1, charMatrix, m2, cm2,
  1424. !                m1 (i, j) == m2 (i, j), "==", 0.0, 1.0);
  1425.       }
  1426.   }
  1427.   
  1428. --- 52,72 ----
  1429.         if (cm2.rows () == 1 && cm2.columns () == 1)
  1430.       return octave_value (cm1 (0, 0) == cm2 (0, 0));
  1431.         else
  1432. !     SC_MX_BOOL_OP (char, c, cm1 (0, 0), \
  1433. !                charMatrix, m, cm2, \
  1434.                  c == m (i, j), 0.0);
  1435.       }
  1436.     else
  1437.       {
  1438. !       if (cm2.rows () == 1 && cm2.columns () == 1)
  1439. !     MX_SC_BOOL_OP (charMatrix, m, cm1, \
  1440. !                char, c, cm2 (0, 0), \
  1441.                  c == m (i, j), 0.0);
  1442.         else
  1443. !     MX_MX_BOOL_OP (charMatrix, m1, cm1, \
  1444. !                charMatrix, m2, cm2, \
  1445. !                m1 (i, j) == m2 (i, j), \
  1446. !                "==", 0.0, 1.0);
  1447.       }
  1448.   }
  1449.   
  1450. diff -cwr g:/project/C/octave-2.09.orig/src/pager.cc g:/project/C/octave-2.09/src/pager.cc
  1451. *** g:/project/C/octave-2.09.orig/src/pager.cc    Wed May 28 03:39:30 1997
  1452. --- g:/project/C/octave-2.09/src/pager.cc    Mon May 26 18:18:04 1997
  1453. ***************
  1454. *** 20,25 ****
  1455. --- 20,27 ----
  1456.   
  1457.   */
  1458.   
  1459. + /* Modified by Klaus Gebhardt, 1996 */
  1460.   #ifdef HAVE_CONFIG_H
  1461.   #include <config.h>
  1462.   #endif
  1463. ***************
  1464. *** 212,218 ****
  1465.   int
  1466.   octave_pager_buf::sync (void)
  1467.   {
  1468. !   if (! interactive
  1469.         || really_flush_to_pager
  1470.         || (Vpage_screen_output && Vpage_output_immediately)
  1471.         || ! Vpage_screen_output)
  1472. --- 214,220 ----
  1473.   int
  1474.   octave_pager_buf::sync (void)
  1475.   {
  1476. !   if ((! interactive || really_forced_interactive)
  1477.         || really_flush_to_pager
  1478.         || (Vpage_screen_output && Vpage_output_immediately)
  1479.         || ! Vpage_screen_output)
  1480. ***************
  1481. *** 221,227 ****
  1482.   
  1483.         char *buf = eback ();
  1484.   
  1485. !       bool bypass_pager = (! interactive
  1486.                  || ! Vpage_screen_output
  1487.                  || (really_flush_to_pager
  1488.                      && Vpage_screen_output
  1489. --- 223,229 ----
  1490.   
  1491.         char *buf = eback ();
  1492.   
  1493. !       bool bypass_pager = ((! interactive || really_forced_interactive)
  1494.                  || ! Vpage_screen_output
  1495.                  || (really_flush_to_pager
  1496.                      && Vpage_screen_output
  1497. diff -cwr g:/project/C/octave-2.09.orig/src/parse.y g:/project/C/octave-2.09/src/parse.y
  1498. *** g:/project/C/octave-2.09.orig/src/parse.y    Wed May 28 03:39:30 1997
  1499. --- g:/project/C/octave-2.09/src/parse.y    Sun Jul 20 18:18:30 1997
  1500. ***************
  1501. *** 20,25 ****
  1502. --- 20,27 ----
  1503.   
  1504.   */
  1505.   
  1506. + /* Modified by Klaus Gebhardt, 1996 */
  1507.   // Parser for Octave.
  1508.   
  1509.   // C decarations.
  1510. ***************
  1511. *** 252,258 ****
  1512.       { \
  1513.         global_command = 0; \
  1514.         yyerrok; \
  1515. !       if (interactive || forced_interactive) \
  1516.       YYACCEPT; \
  1517.         else \
  1518.       YYABORT; \
  1519. --- 254,260 ----
  1520.       { \
  1521.         global_command = 0; \
  1522.         yyerrok; \
  1523. !       if (interactive || forced_interactive || really_forced_interactive) \
  1524.       YYACCEPT; \
  1525.         else \
  1526.       YYABORT; \
  1527. ***************
  1528. *** 370,376 ****
  1529.   %type <subplot_style_type> style
  1530.   
  1531.   // Precedence and associativity.
  1532. ! %left ';' ',' '\n'
  1533.   %right '='
  1534.   %left EXPR_AND_AND EXPR_OR_OR
  1535.   %left EXPR_AND EXPR_OR
  1536. --- 372,378 ----
  1537.   %type <subplot_style_type> style
  1538.   
  1539.   // Precedence and associativity.
  1540. ! %left ';' ',' '\n' '\r' ''
  1541.   %right '='
  1542.   %left EXPR_AND_AND EXPR_OR_OR
  1543.   %left EXPR_AND EXPR_OR
  1544. ***************
  1545. *** 413,422 ****
  1546. --- 415,432 ----
  1547.   
  1548.   input1        : '\n'
  1549.             { $$ = 0; }
  1550. +         | '\r'
  1551. +           { $$ = 0; }
  1552. +         | ''
  1553. +           { $$ = 0; }
  1554.           | simple_list
  1555.             { $$ = $1; }
  1556.           | simple_list '\n'
  1557.             { $$ = $1; }
  1558. +         | simple_list '\r'
  1559. +           { $$ = $1; }
  1560. +         | simple_list ''
  1561. +           { $$ = $1; }
  1562.           | simple_list END_OF_INPUT
  1563.             { $$ = $1; }
  1564.           ;
  1565. ***************
  1566. *** 1069,1080 ****
  1567. --- 1079,1092 ----
  1568.             }
  1569.           | param_list1 param_list_end
  1570.             {
  1571. +             lexer_flags.looking_at_parameter_list = 0;
  1572.               lexer_flags.quote_is_transpose = 0;
  1573.               $1->mark_as_formal_parameters ();
  1574.               $$ = $1;
  1575.             }
  1576.           | param_list1 ',' ELLIPSIS param_list_end
  1577.             {
  1578. +             lexer_flags.looking_at_parameter_list = 0;
  1579.               lexer_flags.quote_is_transpose = 0;
  1580.               $1->mark_as_formal_parameters ();
  1581.               $1->mark_varargs ();
  1582. ***************
  1583. *** 1201,1212 ****
  1584. --- 1213,1228 ----
  1585.             { $$ = ';'; }
  1586.           | '\n'
  1587.             { $$ = '\n'; }
  1588. +         | '\r'
  1589. +           { $$ = '\r'; }
  1590.           | sep ','
  1591.             { $$ = $1; }
  1592.           | sep ';'
  1593.             { $$ = $1; }
  1594.           | sep '\n'
  1595.             { $$ = $1; }
  1596. +         | sep '\r'
  1597. +           { $$ = $1; }
  1598.           ;
  1599.   
  1600.   opt_sep        : // empty
  1601. ***************
  1602. *** 2331,2336 ****
  1603. --- 2347,2353 ----
  1604.       case 0:
  1605.       case ',':
  1606.       case '\n':
  1607. +     case '\r':
  1608.         if (warn_missing_semi)
  1609.       maybe_warn_missing_semi (list);
  1610.         break;
  1611. diff -cwr g:/project/C/octave-2.09.orig/src/pt-plot.cc g:/project/C/octave-2.09/src/pt-plot.cc
  1612. *** g:/project/C/octave-2.09.orig/src/pt-plot.cc    Wed May 28 03:36:46 1997
  1613. --- g:/project/C/octave-2.09/src/pt-plot.cc    Fri Mar  7 04:48:20 1997
  1614. ***************
  1615. *** 20,25 ****
  1616. --- 20,27 ----
  1617.   
  1618.   */
  1619.   
  1620. + /* Modified by Klaus Gebhardt, 1996 */
  1621.   #if defined (__GNUG__)
  1622.   #pragma implementation
  1623.   #endif
  1624. ***************
  1625. *** 172,184 ****
  1626.         sigemptyset (&set);
  1627.         sigaddset (&set, SIGINT);
  1628.         sigprocmask (SIG_BLOCK, &set, &oset);
  1629.   #else
  1630.        volatile octave_interrupt_handler old_interrupt_handler
  1631.       = octave_ignore_interrupts ();
  1632.   #endif
  1633.         plot_stream = new oprocstream (plot_prog.c_str ());
  1634.         if (plot_stream)
  1635.       {
  1636.         if (! *plot_stream)
  1637. --- 174,190 ----
  1638.         sigemptyset (&set);
  1639.         sigaddset (&set, SIGINT);
  1640.         sigprocmask (SIG_BLOCK, &set, &oset);
  1641. + #endif
  1642. + #if defined (__EMX__) && defined (OS2)
  1643. +       plot_stream = new oprocstream (plot_prog.c_str (), ios::out);
  1644.   #else
  1645. + #if !defined (HAVE_POSIX_SIGNALS)
  1646.         volatile octave_interrupt_handler old_interrupt_handler
  1647.       = octave_ignore_interrupts ();
  1648.   #endif
  1649.         plot_stream = new oprocstream (plot_prog.c_str ());
  1650. ! #endif
  1651.         if (plot_stream)
  1652.       {
  1653.         if (! *plot_stream)
  1654. ***************
  1655. *** 201,208 ****
  1656. --- 207,216 ----
  1657.   #if defined (HAVE_POSIX_SIGNALS)
  1658.         sigprocmask (SIG_SETMASK, &oset, 0);
  1659.   #else
  1660. + #if ! defined (__EMX__) || ! defined (OS2)
  1661.         octave_set_interrupt_handler (old_interrupt_handler);
  1662.   #endif
  1663. + #endif
  1664.       }
  1665.   
  1666.     if (! error_state && plot_stream && *plot_stream && ! initialized)
  1667. ***************
  1668. *** 1090,1095 ****
  1669. --- 1098,1104 ----
  1670.   
  1671.     char *plot_command = plot_buf.str ();
  1672.     send_to_plot_stream (plot_command);
  1673. +   sleep (2);
  1674.   
  1675.     delete [] plot_command;
  1676.   
  1677. diff -cwr g:/project/C/octave-2.09.orig/src/rand.cc g:/project/C/octave-2.09/src/rand.cc
  1678. *** g:/project/C/octave-2.09.orig/src/rand.cc    Sun Nov  3 09:22:46 1996
  1679. --- g:/project/C/octave-2.09/src/rand.cc    Sat Jul 19 14:30:48 1997
  1680. ***************
  1681. *** 20,25 ****
  1682. --- 20,27 ----
  1683.   
  1684.   */
  1685.   
  1686. + /* Modified by Klaus Gebhardt, 1997 */
  1687.   #ifdef HAVE_CONFIG_H
  1688.   #include <config.h>
  1689.   #endif
  1690. ***************
  1691. *** 72,78 ****
  1692.   {
  1693.     union d2i { double d; int i[2]; };
  1694.     union d2i u;
  1695. !   F77_FCN (getsd, GETSD) (u.i[0], u.i[1]);
  1696.     return u.d;
  1697.   }
  1698.   
  1699. --- 74,80 ----
  1700.   {
  1701.     union d2i { double d; int i[2]; };
  1702.     union d2i u;
  1703. !   F77_XFCN (getsd, GETSD, (u.i[0], u.i[1]));
  1704.     return u.d;
  1705.   }
  1706.   
  1707. ***************
  1708. *** 99,105 ****
  1709.     u.d = val;
  1710.     int i0 = force_to_fit_range (u.i[0], 1, 2147483563);
  1711.     int i1 = force_to_fit_range (u.i[1], 1, 2147483399);
  1712. !   F77_FCN (setsd, SETSD) (i0, i1);
  1713.   }
  1714.   
  1715.   static char *
  1716. --- 101,107 ----
  1717.     u.d = val;
  1718.     int i0 = force_to_fit_range (u.i[0], 1, 2147483563);
  1719.     int i1 = force_to_fit_range (u.i[1], 1, 2147483399);
  1720. !   F77_XFCN (setsd, SETSD, (i0, i1));
  1721.   }
  1722.   
  1723.   static char *
  1724. ***************
  1725. *** 140,146 ****
  1726.     s0 = force_to_fit_range (s0, 1, 2147483563);
  1727.     s1 = force_to_fit_range (s1, 1, 2147483399);
  1728.   
  1729. !   F77_FCN (setall, SETALL) (s0, s1);
  1730.   
  1731.     initialized = 1;
  1732.   }
  1733. --- 142,148 ----
  1734.     s0 = force_to_fit_range (s0, 1, 2147483563);
  1735.     s1 = force_to_fit_range (s1, 1, 2147483399);
  1736.   
  1737. !   F77_XFCN (setall, SETALL, (s0, s1));
  1738.   
  1739.     initialized = 1;
  1740.   }
  1741. ***************
  1742. *** 180,192 ****
  1743.           {
  1744.             current_distribution = uniform_dist;
  1745.   
  1746. !           F77_FCN (setcgn, SETCGN) (uniform_dist);
  1747.           }
  1748.         else if (s_arg == "normal")
  1749.           {
  1750.             current_distribution = normal_dist;
  1751.   
  1752. !           F77_FCN (setcgn, SETCGN) (normal_dist);
  1753.           }
  1754.         else
  1755.           error ("rand: unrecognized string argument");
  1756. --- 182,194 ----
  1757.           {
  1758.             current_distribution = uniform_dist;
  1759.   
  1760. !           F77_XFCN (setcgn, SETCGN, (uniform_dist));
  1761.           }
  1762.         else if (s_arg == "normal")
  1763.           {
  1764.             current_distribution = normal_dist;
  1765.   
  1766. !           F77_XFCN (setcgn, SETCGN, (normal_dist));
  1767.           }
  1768.         else
  1769.           error ("rand: unrecognized string argument");
  1770. ***************
  1771. *** 302,313 ****
  1772.           switch (current_distribution)
  1773.             {
  1774.             case uniform_dist:
  1775. !         F77_FCN (dgenunf, DGENUNF) (0.0, 1.0, val);
  1776.           rand_mat (i, j) = val;
  1777.           break;
  1778.   
  1779.             case normal_dist:
  1780. !         F77_FCN (dgennor, DGENNOR) (0.0, 1.0, val);
  1781.           rand_mat (i, j) = val;
  1782.           break;
  1783.   
  1784. --- 304,315 ----
  1785.           switch (current_distribution)
  1786.             {
  1787.             case uniform_dist:
  1788. !         F77_XFCN (dgenunf, DGENUNF, (0.0, 1.0, val));
  1789.           rand_mat (i, j) = val;
  1790.           break;
  1791.   
  1792.             case normal_dist:
  1793. !         F77_XFCN (dgennor, DGENNOR, (0.0, 1.0, val));
  1794.           rand_mat (i, j) = val;
  1795.           break;
  1796.   
  1797. ***************
  1798. *** 356,362 ****
  1799.   static void
  1800.   reset_rand_generator (void *)
  1801.   {
  1802. !   F77_FCN (setcgn, SETCGN) (current_distribution);
  1803.   }
  1804.   
  1805.   DEFUN_DLD (randn, args, nargout,
  1806. --- 358,364 ----
  1807.   static void
  1808.   reset_rand_generator (void *)
  1809.   {
  1810. !   F77_XFCN (setcgn, SETCGN, (current_distribution));
  1811.   }
  1812.   
  1813.   DEFUN_DLD (randn, args, nargout,
  1814. ***************
  1815. *** 393,399 ****
  1816.   
  1817.         current_distribution = normal_dist;
  1818.   
  1819. !       F77_FCN (setcgn, SETCGN) (normal_dist);
  1820.   
  1821.         retval = do_rand (args, nargin);
  1822.   
  1823. --- 395,401 ----
  1824.   
  1825.         current_distribution = normal_dist;
  1826.   
  1827. !       F77_XFCN (setcgn, SETCGN, (normal_dist));
  1828.   
  1829.         retval = do_rand (args, nargin);
  1830.   
  1831. diff -cwr g:/project/C/octave-2.09.orig/src/sighandlers.cc g:/project/C/octave-2.09/src/sighandlers.cc
  1832. *** g:/project/C/octave-2.09.orig/src/sighandlers.cc    Wed May 28 03:39:30 1997
  1833. --- g:/project/C/octave-2.09/src/sighandlers.cc    Thu May 29 23:00:32 1997
  1834. ***************
  1835. *** 20,25 ****
  1836. --- 20,27 ----
  1837.   
  1838.   */
  1839.   
  1840. + /* Modified by Klaus Gebhardt, 1995 - 1996 */
  1841.   #ifdef HAVE_CONFIG_H
  1842.   #include <config.h>
  1843.   #endif
  1844. ***************
  1845. *** 38,43 ****
  1846. --- 40,50 ----
  1847.   #include <unistd.h>
  1848.   #endif
  1849.   
  1850. + #ifdef __EMX__
  1851. + #include <float.h>
  1852. + #include <sys/uflags.h>
  1853. + #endif
  1854.   #include "error.h"
  1855.   #include "load-save.h"
  1856.   #include "pager.h"
  1857. ***************
  1858. *** 81,87 ****
  1859.   
  1860.   #if defined (__EMX__)
  1861.   #define MAYBE_ACK_SIGNAL(sig) \
  1862. !   octave_set_signal_handler (sig, SIG_ACK)
  1863.   #else
  1864.   #define MAYBE_ACK_SIGNAL(sig) \
  1865.     do { } while (0)
  1866. --- 88,94 ----
  1867.   
  1868.   #if defined (__EMX__)
  1869.   #define MAYBE_ACK_SIGNAL(sig) \
  1870. !   signal (sig, SIG_ACK)
  1871.   #else
  1872.   #define MAYBE_ACK_SIGNAL(sig) \
  1873.     do { } while (0)
  1874. ***************
  1875. *** 122,128 ****
  1876.       {
  1877.         been_there_done_that = true;
  1878.   
  1879. !       cerr << "error: " << sig_name << " -- stopping myself...\n";
  1880.   
  1881.         save_user_variables ();
  1882.   
  1883. --- 129,135 ----
  1884.       {
  1885.         been_there_done_that = true;
  1886.   
  1887. !       cerr << "\n\nerror: " << sig_name << " -- stopping myself...\n";
  1888.   
  1889.         save_user_variables ();
  1890.   
  1891. ***************
  1892. *** 139,144 ****
  1893. --- 146,154 ----
  1894.   
  1895.     if (can_interrupt)
  1896.       {
  1897. + #ifdef __EMX__
  1898. +       _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
  1899. + #endif
  1900.         jump_to_top_level ();
  1901.         panic_impossible ();
  1902.       }
  1903. ***************
  1904. *** 157,162 ****
  1905. --- 167,176 ----
  1906.     sigemptyset (&oact.sa_mask);
  1907.     sigaction (sig, &act, &oact);
  1908.     return oact.sa_handler;
  1909. + #elif defined (__EMX__)
  1910. +   sig_handler *signal_handler = signal (sig, handler);
  1911. +   MAYBE_ACK_SIGNAL(sig);
  1912. +   return signal_handler;
  1913.   #else
  1914.     return signal (sig, handler);
  1915.   #endif
  1916. ***************
  1917. *** 173,179 ****
  1918.   // Handle SIGCHLD.
  1919.   
  1920.   static RETSIGTYPE
  1921. ! sigchld_handler (int /* sig */)
  1922.   {
  1923.     volatile octave_interrupt_handler saved_interrupt_handler
  1924.        = octave_ignore_interrupts ();
  1925. --- 187,193 ----
  1926.   // Handle SIGCHLD.
  1927.   
  1928.   static RETSIGTYPE
  1929. ! sigchld_handler (int sig )
  1930.   {
  1931.     volatile octave_interrupt_handler saved_interrupt_handler
  1932.       = octave_ignore_interrupts ();
  1933. ***************
  1934. *** 185,205 ****
  1935.   #if defined (__EMX__)
  1936.     volatile sig_handler *saved_sigchld_handler
  1937.       = octave_set_signal_handler (SIGCHLD, SIG_IGN);
  1938. ! #endif
  1939.     sigset_t set, oset;
  1940.   
  1941.     BLOCK_CHILD (set, oset);
  1942.   
  1943.     int n = octave_child_list::length ();
  1944.   
  1945. !   if (n == 0)
  1946. !     {
  1947. !       waitpid (-1, 0, WNOHANG);
  1948. !     }
  1949. !   else
  1950. !     {
  1951. !       for (int i = 0; i < n; i++)
  1952.       {
  1953.         octave_child& elt = octave_child_list::elem (i);
  1954.   
  1955. --- 199,214 ----
  1956.   #if defined (__EMX__)
  1957.     volatile sig_handler *saved_sigchld_handler
  1958.       = octave_set_signal_handler (SIGCHLD, SIG_IGN);
  1959. ! #else
  1960.     sigset_t set, oset;
  1961.   
  1962.     BLOCK_CHILD (set, oset);
  1963. + #endif
  1964.   
  1965. +   int i = 0;
  1966.     int n = octave_child_list::length ();
  1967.   
  1968. !   for (i = 0; i < n; i++)
  1969.       {
  1970.         octave_child& elt = octave_child_list::elem (i);
  1971.   
  1972. ***************
  1973. *** 215,234 ****
  1974.   
  1975.             octave_child::dead_child_handler f = elt.handler;
  1976.   
  1977. !           if (f)
  1978. !             f (pid, status);
  1979.   
  1980.             break;
  1981.           }
  1982.           }
  1983.       }
  1984. !     }
  1985.   
  1986.     octave_set_interrupt_handler (saved_interrupt_handler);
  1987.   
  1988.     UNBLOCK_CHILD (oset);
  1989. ! #ifdef __EMX__
  1990.     octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
  1991.   #endif
  1992.   
  1993. --- 224,248 ----
  1994.   
  1995.             octave_child::dead_child_handler f = elt.handler;
  1996.   
  1997. !           if (f)  f (pid, status);
  1998. !           else
  1999. !         {
  2000. !           string file = elt.filename;
  2001. !           unlink (file.c_str ());
  2002. !         }
  2003.   
  2004.             break;
  2005.           }
  2006.       }
  2007.       }
  2008. !   if (i == n)  waitpid (-1, NULL, WNOHANG);
  2009.   
  2010.     octave_set_interrupt_handler (saved_interrupt_handler);
  2011.   
  2012. + #ifndef __EMX__
  2013.     UNBLOCK_CHILD (oset);
  2014. ! #else
  2015.     octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
  2016.   #endif
  2017.   
  2018. ***************
  2019. *** 241,247 ****
  2020.   
  2021.   #if defined (__alpha__)
  2022.   static RETSIGTYPE
  2023. ! sigfpe_handler (int /* sig */)
  2024.   {
  2025.     MAYBE_ACK_SIGNAL (SIGFPE);
  2026.   
  2027. --- 255,261 ----
  2028.   
  2029.   #if defined (__alpha__)
  2030.   static RETSIGTYPE
  2031. ! sigfpe_handler (int sig)
  2032.   {
  2033.     MAYBE_ACK_SIGNAL (SIGFPE);
  2034.   
  2035. ***************
  2036. *** 251,256 ****
  2037. --- 265,274 ----
  2038.   
  2039.     if (can_interrupt)
  2040.       {
  2041. + #if defined (__EMX__)
  2042. +       _control87 (EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW |
  2043. +           EM_UNDERFLOW | EM_INEXACT, MCW_EM);
  2044. + #endif
  2045.         jump_to_top_level ();
  2046.         panic_impossible ();
  2047.       }
  2048. ***************
  2049. *** 282,288 ****
  2050.   }
  2051.   
  2052.   static RETSIGTYPE
  2053. ! sigpipe_handler (int /* sig */)
  2054.   {
  2055.     MAYBE_ACK_SIGNAL (SIGPIPE);
  2056.   
  2057. --- 300,306 ----
  2058.   }
  2059.   
  2060.   static RETSIGTYPE
  2061. ! sigpipe_handler (int sig)
  2062.   {
  2063.     MAYBE_ACK_SIGNAL (SIGPIPE);
  2064.   
  2065. ***************
  2066. *** 305,315 ****
  2067.     octave_interrupt_handler retval;
  2068.   
  2069.   #ifdef SIGINT
  2070. !   retval.int_handler = octave_set_signal_handler (SIGINT, sigint_handler);
  2071.   #endif
  2072.   
  2073.   #ifdef SIGBREAK
  2074. !   retval.brk_handler = octave_set_signal_handler (SIGBREAK, sigint_handler);
  2075.   #endif
  2076.   
  2077.     return retval;
  2078. --- 323,337 ----
  2079.     octave_interrupt_handler retval;
  2080.   
  2081.   #ifdef SIGINT
  2082. !   octave_set_signal_handler (SIGINT, sigint_handler);
  2083. !   retval.int_handler = sigint_handler;
  2084. !   MAYBE_ACK_SIGNAL (SIGINT);
  2085.   #endif
  2086.   
  2087.   #ifdef SIGBREAK
  2088. !   octave_set_signal_handler (SIGBREAK, sigint_handler);
  2089. !   retval.brk_handler = sigint_handler;
  2090. !   MAYBE_ACK_SIGNAL (SIGBREAK);
  2091.   #endif
  2092.   
  2093.     return retval;
  2094. ***************
  2095. *** 332,347 ****
  2096. --- 354,392 ----
  2097.   }
  2098.   
  2099.   octave_interrupt_handler
  2100. + octave_set_interrupt_handler (RETSIGTYPE (*f)(int))
  2101. + {
  2102. +   octave_interrupt_handler retval;
  2103. +   if (f)
  2104. +     {
  2105. + #ifdef SIGINT
  2106. +       retval.int_handler = octave_set_signal_handler (SIGINT, f);
  2107. +       MAYBE_ACK_SIGNAL (SIGINT);
  2108. + #endif
  2109. + #ifdef SIGBREAK
  2110. +       retval.brk_handler = octave_set_signal_handler (SIGBREAK, f);
  2111. +       MAYBE_ACK_SIGNAL (SIGBREAK);
  2112. + #endif
  2113. +     }
  2114. +   return retval;
  2115. + }
  2116. + octave_interrupt_handler
  2117.   octave_set_interrupt_handler (const volatile octave_interrupt_handler& h)
  2118.   {
  2119.     octave_interrupt_handler retval;
  2120.   
  2121.   #ifdef SIGINT
  2122.     retval.int_handler = octave_set_signal_handler (SIGINT, h.int_handler);
  2123. +   MAYBE_ACK_SIGNAL (SIGINT);
  2124.   #endif
  2125.   
  2126.   #ifdef SIGBREAK
  2127.     retval.brk_handler = octave_set_signal_handler (SIGBREAK, h.brk_handler);
  2128. +   MAYBE_ACK_SIGNAL (SIGBREAK);
  2129.   #endif
  2130.   
  2131.     return retval;
  2132. ***************
  2133. *** 425,432 ****
  2134. --- 470,481 ----
  2135.   #endif
  2136.   
  2137.   #ifdef SIGTERM
  2138. + #ifdef __EMX__
  2139. +   signal (SIGTERM, SIG_DFL);
  2140. + #else
  2141.     octave_set_signal_handler (SIGTERM, generic_sig_handler);
  2142.   #endif
  2143. + #endif
  2144.   
  2145.   #ifdef SIGTRAP
  2146.     octave_set_signal_handler (SIGTRAP, generic_sig_handler);
  2147. ***************
  2148. *** 570,576 ****
  2149.   octave_child_list *octave_child_list::instance = 0;
  2150.   
  2151.   void
  2152. ! octave_child_list::do_insert (pid_t pid, octave_child::dead_child_handler f)
  2153.   {
  2154.     // Insert item in first open slot, increasing size of list if
  2155.     // necessary.
  2156. --- 619,626 ----
  2157.   octave_child_list *octave_child_list::instance = 0;
  2158.   
  2159.   void
  2160. ! octave_child_list::do_insert (pid_t pid, octave_child::dead_child_handler f,
  2161. !                   string name)
  2162.   {
  2163.     // Insert item in first open slot, increasing size of list if
  2164.     // necessary.
  2165. ***************
  2166. *** 583,589 ****
  2167.   
  2168.         if (tmp.pid < 0)
  2169.       {
  2170. !       list (i) = octave_child (pid, f);
  2171.         enlarge = false;
  2172.         break;
  2173.       }
  2174. --- 633,639 ----
  2175.   
  2176.         if (tmp.pid < 0)
  2177.       {
  2178. !       list (i) = octave_child (pid, f, name);
  2179.         enlarge = false;
  2180.         break;
  2181.       }
  2182. ***************
  2183. *** 601,619 ****
  2184.           list.resize (total_len * 2);
  2185.       }
  2186.   
  2187. !       list (curr_len) = octave_child (pid, f);
  2188.         curr_len++;
  2189.       }
  2190.   }
  2191.   
  2192.   void
  2193. ! octave_child_list::insert (pid_t pid, octave_child::dead_child_handler f)
  2194.   {
  2195.     if (! instance)
  2196.       instance = new octave_child_list ();
  2197.   
  2198.     if (instance)
  2199. !     instance->do_insert (pid, f);
  2200.     else
  2201.       panic_impossible ();
  2202.   }
  2203. --- 651,670 ----
  2204.           list.resize (total_len * 2);
  2205.       }
  2206.   
  2207. !       list (curr_len) = octave_child (pid, f, name);
  2208.         curr_len++;
  2209.       }
  2210.   }
  2211.   
  2212.   void
  2213. ! octave_child_list::insert (pid_t pid, octave_child::dead_child_handler f,
  2214. !                string name)
  2215.   {
  2216.     if (! instance)
  2217.       instance = new octave_child_list ();
  2218.   
  2219.     if (instance)
  2220. !     instance->do_insert (pid, f, name);
  2221.     else
  2222.       panic_impossible ();
  2223.   }
  2224. diff -cwr g:/project/C/octave-2.09.orig/src/sighandlers.h g:/project/C/octave-2.09/src/sighandlers.h
  2225. *** g:/project/C/octave-2.09.orig/src/sighandlers.h    Wed May 28 03:36:48 1997
  2226. --- g:/project/C/octave-2.09/src/sighandlers.h    Fri Mar  7 19:43:30 1997
  2227. ***************
  2228. *** 22,30 ****
  2229. --- 22,34 ----
  2230.   
  2231.   // This file should always be included after config.h!
  2232.   
  2233. + /* Modified by Klaus Gebhardt, 1996 */
  2234.   #if !defined (octave_sighandlers_h)
  2235.   #define octave_sighandlers_h 1
  2236.   
  2237. + #include <string>
  2238.   #include <Array.h>
  2239.   
  2240.   #include "syswait.h"
  2241. ***************
  2242. *** 59,66 ****
  2243.   
  2244.   typedef RETSIGTYPE sig_handler (int);
  2245.   
  2246. - // XXX FIXME XXX -- the data should probably be private...
  2247.   struct
  2248.   octave_interrupt_handler
  2249.   {
  2250. --- 63,68 ----
  2251. ***************
  2252. *** 89,94 ****
  2253. --- 91,99 ----
  2254.   extern octave_interrupt_handler octave_ignore_interrupts (void);
  2255.   
  2256.   extern octave_interrupt_handler 
  2257. + octave_set_interrupt_handler (RETSIGTYPE (*)(int));
  2258. + extern octave_interrupt_handler 
  2259.   octave_set_interrupt_handler (const volatile octave_interrupt_handler&);
  2260.   
  2261.   extern void octave_save_signal_mask (void);
  2262. ***************
  2263. *** 112,122 ****
  2264.   
  2265.     typedef void (*dead_child_handler) (pid_t, int);
  2266.   
  2267. !   octave_child (pid_t id = -1, dead_child_handler f = 0)
  2268. !     : pid (id), handler (f) { }
  2269.   
  2270.     octave_child (const octave_child& oc)
  2271. !     : pid (oc.pid), handler (oc.handler) { }
  2272.   
  2273.     octave_child& operator = (const octave_child& oc)
  2274.       {
  2275. --- 117,127 ----
  2276.   
  2277.     typedef void (*dead_child_handler) (pid_t, int);
  2278.   
  2279. !   octave_child (pid_t id = -1, dead_child_handler f = 0, string name = "")
  2280. !     : pid (id), handler (f), filename (name) { }
  2281.   
  2282.     octave_child (const octave_child& oc)
  2283. !     : pid (oc.pid), handler (oc.handler), filename (oc.filename) { }
  2284.   
  2285.     octave_child& operator = (const octave_child& oc)
  2286.       {
  2287. ***************
  2288. *** 124,129 ****
  2289. --- 129,135 ----
  2290.       {
  2291.         pid = oc.pid;
  2292.         handler = oc.handler;
  2293. +       filename = oc.filename;
  2294.       }
  2295.         return *this;
  2296.       }
  2297. ***************
  2298. *** 135,140 ****
  2299. --- 141,149 ----
  2300.   
  2301.     // The function we call if this child dies.
  2302.     dead_child_handler handler;
  2303. +   // The file to remove if this child dies.
  2304. +   string filename;
  2305.   };
  2306.   
  2307.   class
  2308. ***************
  2309. *** 148,154 ****
  2310.   
  2311.     ~octave_child_list (void) { }
  2312.   
  2313. !   static void insert (pid_t pid, octave_child::dead_child_handler f);
  2314.   
  2315.     static void remove (pid_t pid);
  2316.   
  2317. --- 157,164 ----
  2318.   
  2319.     ~octave_child_list (void) { }
  2320.   
  2321. !   static void insert (pid_t pid, octave_child::dead_child_handler f,
  2322. !               string name = "");
  2323.   
  2324.     static void remove (pid_t pid);
  2325.   
  2326. ***************
  2327. *** 177,183 ****
  2328.   
  2329.     static octave_child_list *instance;
  2330.   
  2331. !   void do_insert (pid_t pid, octave_child::dead_child_handler f);
  2332.   
  2333.     void do_remove (pid_t pid);
  2334.   };
  2335. --- 187,194 ----
  2336.   
  2337.     static octave_child_list *instance;
  2338.   
  2339. !   void do_insert (pid_t pid, octave_child::dead_child_handler f,
  2340. !           string name = "");
  2341.   
  2342.     void do_remove (pid_t pid);
  2343.   };
  2344. diff -cwr g:/project/C/octave-2.09.orig/src/strftime.c g:/project/C/octave-2.09/src/strftime.c
  2345. *** g:/project/C/octave-2.09.orig/src/strftime.c    Wed May 28 03:37:42 1997
  2346. --- g:/project/C/octave-2.09/src/strftime.c    Fri Mar  7 22:55:12 1997
  2347. ***************
  2348. *** 47,53 ****
  2349.   # endif
  2350.   #endif
  2351.   
  2352. ! #if HAVE_TZNAME
  2353.   extern char *tzname[];
  2354.   #endif
  2355.   
  2356. --- 47,53 ----
  2357.   # endif
  2358.   #endif
  2359.   
  2360. ! #ifdef HAVE_TZNAME
  2361.   extern char *tzname[];
  2362.   #endif
  2363.   
  2364. ***************
  2365. *** 59,66 ****
  2366.      with other C libraries that use unsafe encodings.  */
  2367.   #define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
  2368.   
  2369. ! #if DO_MULTIBYTE
  2370. ! # if HAVE_MBRLEN
  2371.   #  include <wchar.h>
  2372.   # else
  2373.      /* Simulate mbrlen with mblen as best we can.  */
  2374. --- 59,66 ----
  2375.      with other C libraries that use unsafe encodings.  */
  2376.   #define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
  2377.   
  2378. ! #ifdef DO_MULTIBYTE
  2379. ! #ifdef HAVE_MBRLEN
  2380.   #include <wchar.h>
  2381.   #else
  2382.   /* Simulate mbrlen with mblen as best we can.  */
  2383. ***************
  2384. *** 71,81 ****
  2385.     static const mbstate_t mbstate_zero;
  2386.   #endif
  2387.   
  2388. ! #if HAVE_LIMITS_H
  2389.   # include <limits.h>
  2390.   #endif
  2391.   
  2392. ! #if STDC_HEADERS
  2393.   # include <stddef.h>
  2394.   # include <stdlib.h>
  2395.   # include <string.h>
  2396. --- 71,81 ----
  2397.   static const mbstate_t mbstate_zero;
  2398.   #endif
  2399.   
  2400. ! #ifdef HAVE_LIMITS_H
  2401.   #include <limits.h>
  2402.   #endif
  2403.   
  2404. ! #ifdef STDC_HEADERS
  2405.   #include <stddef.h>
  2406.   #include <stdlib.h>
  2407.   #include <string.h>
  2408. ***************
  2409. *** 178,184 ****
  2410.       } while (0)
  2411.   #define    cpy(n, s)    add ((n), memcpy((PTR) p, (PTR) (s), (n)))
  2412.   
  2413. ! #if ! HAVE_TM_GMTOFF
  2414.   /* Yield the difference between *A and *B,
  2415.      measured in seconds, ignoring leap seconds.  */
  2416.   static int tm_diff __P ((const struct tm *, const struct tm *));
  2417. --- 178,184 ----
  2418.       } while (0)
  2419.   #define    cpy(n, s)    add ((n), memcpy((PTR) p, (PTR) (s), (n)))
  2420.   
  2421. ! #ifndef HAVE_TM_GMTOFF
  2422.   /* Yield the difference between *A and *B,
  2423.      measured in seconds, ignoring leap seconds.  */
  2424.   static int tm_diff __P ((const struct tm *, const struct tm *));
  2425. ***************
  2426. *** 288,297 ****
  2427.     register const char *f;
  2428.   
  2429.     zone = 0;
  2430. ! #if HAVE_TM_ZONE
  2431.     zone = (const char *) tp->tm_zone;
  2432.   #endif
  2433. ! #if HAVE_TZNAME
  2434.     if (!(zone && *zone) && tp->tm_isdst >= 0)
  2435.       zone = tzname[tp->tm_isdst];
  2436.   #endif
  2437. --- 288,297 ----
  2438.     register const char *f;
  2439.   
  2440.     zone = 0;
  2441. ! #ifdef HAVE_TM_ZONE
  2442.     zone = (const char *) tp->tm_zone;
  2443.   #endif
  2444. ! #ifdef HAVE_TZNAME
  2445.     if (!(zone && *zone) && tp->tm_isdst >= 0)
  2446.       zone = tzname[tp->tm_isdst];
  2447.   #endif
  2448. ***************
  2449. *** 318,324 ****
  2450.               ? INT_STRLEN_BOUND (time_t)
  2451.               : INT_STRLEN_BOUND (int))];
  2452.   
  2453. ! #if DO_MULTIBYTE
  2454.   
  2455.          switch (*f)
  2456.       {
  2457. --- 318,324 ----
  2458.               ? INT_STRLEN_BOUND (time_t)
  2459.               : INT_STRLEN_BOUND (int))];
  2460.   
  2461. ! #ifdef DO_MULTIBYTE
  2462.   
  2463.          switch (*f)
  2464.       {
  2465. ***************
  2466. *** 480,486 ****
  2467.       case 'C':        /* POSIX.2 extension.  */
  2468.         if (modifier == 'O')
  2469.           goto bad_format;
  2470. ! #if HAVE_STRUCT_ERA_ENTRY
  2471.         if (modifier == 'E')
  2472.           {
  2473.             struct era_entry *era = _nl_get_era_entry (tp);
  2474. --- 480,486 ----
  2475.       case 'C':        /* POSIX.2 extension.  */
  2476.         if (modifier == 'O')
  2477.           goto bad_format;
  2478. ! #ifdef HAVE_STRUCT_ERA_ENTRY
  2479.         if (modifier == 'E')
  2480.           {
  2481.             struct era_entry *era = _nl_get_era_entry (tp);
  2482. ***************
  2483. *** 781,787 ****
  2484.         DO_NUMBER (1, tp->tm_wday);
  2485.   
  2486.       case 'Y':
  2487. ! #if HAVE_STRUCT_ERA_ENTRY
  2488.         if (modifier == 'E')
  2489.           {
  2490.             struct era_entry *era = _nl_get_era_entry (tp);
  2491. --- 781,787 ----
  2492.         DO_NUMBER (1, tp->tm_wday);
  2493.   
  2494.       case 'Y':
  2495. ! #ifdef HAVE_STRUCT_ERA_ENTRY
  2496.         if (modifier == 'E')
  2497.           {
  2498.             struct era_entry *era = _nl_get_era_entry (tp);
  2499. ***************
  2500. *** 798,804 ****
  2501.           DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
  2502.   
  2503.       case 'y':
  2504. ! #if HAVE_STRUCT_ERA_ENTRY
  2505.         if (modifier == 'E')
  2506.           {
  2507.             struct era_entry *era = _nl_get_era_entry (tp);
  2508. --- 798,804 ----
  2509.           DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
  2510.   
  2511.       case 'y':
  2512. ! #ifdef HAVE_STRUCT_ERA_ENTRY
  2513.         if (modifier == 'E')
  2514.           {
  2515.             struct era_entry *era = _nl_get_era_entry (tp);
  2516. ***************
  2517. *** 822,828 ****
  2518.   
  2519.         {
  2520.           int diff;
  2521. ! #if HAVE_TM_GMTOFF
  2522.           diff = tp->tm_gmtoff;
  2523.   #else
  2524.           struct tm gtm;
  2525. --- 822,828 ----
  2526.   
  2527.         {
  2528.           int diff;
  2529. ! #ifdef HAVE_TM_GMTOFF
  2530.           diff = tp->tm_gmtoff;
  2531.   #else
  2532.           struct tm gtm;
  2533. diff -cwr g:/project/C/octave-2.09.orig/src/syscalls.cc g:/project/C/octave-2.09/src/syscalls.cc
  2534. *** g:/project/C/octave-2.09.orig/src/syscalls.cc    Wed May 28 03:39:30 1997
  2535. --- g:/project/C/octave-2.09/src/syscalls.cc    Tue May 27 15:31:30 1997
  2536. ***************
  2537. *** 25,30 ****
  2538. --- 25,32 ----
  2539.   //
  2540.   //   mkfifo  unlink  waitpid
  2541.   
  2542. + /* Modified by Klaus Gebhardt, 1996 */
  2543.   #ifdef HAVE_CONFIG_H
  2544.   #include <config.h>
  2545.   #endif
  2546. ***************
  2547. *** 32,37 ****
  2548. --- 34,40 ----
  2549.   #include <cerrno>
  2550.   #include <cstdio>
  2551.   #include <cstring>
  2552. + #include <csignal>
  2553.   
  2554.   #ifdef HAVE_UNISTD_H
  2555.   #ifdef HAVE_SYS_TYPES_H
  2556. ***************
  2557. *** 44,49 ****
  2558. --- 47,54 ----
  2559.   #include <fcntl.h>
  2560.   #endif
  2561.   
  2562. + #include <process.h>
  2563.   #include "defun.h"
  2564.   #include "error.h"
  2565.   #include "file-ops.h"
  2566. ***************
  2567. *** 54,59 ****
  2568. --- 59,66 ----
  2569.   #include "oct-obj.h"
  2570.   #include "oct-stdstrm.h"
  2571.   #include "oct-stream.h"
  2572. + #include "oct-fstrm.h"
  2573. + #include "sighandlers.h"
  2574.   #include "sysdep.h"
  2575.   #include "syswait.h"
  2576.   #include "utils.h"
  2577. ***************
  2578. *** 87,94 ****
  2579.     return m;
  2580.   }
  2581.   
  2582. ! DEFUN (dup2, args, ,
  2583. !  "[FID, MSG] = dup2 (OLD, NEW)\n\
  2584.   \n\
  2585.   Duplicate a file descriptor.\n\
  2586.   \n\
  2587. --- 94,148 ----
  2588.     return m;
  2589.   }
  2590.   
  2591. ! DEFUN (_dup, args, ,
  2592. !  "[FID, MSG] = _dup (old): duplicate a file descriptor")
  2593. ! {
  2594. !   octave_value_list retval;
  2595. !   retval(1) = string ();
  2596. !   retval(0) = -1.0;
  2597. !   int nargin = args.length ();
  2598. !   if (nargin == 1)
  2599. !     {
  2600. ! #if defined (HAVE_DUP)
  2601. !       double d_old = args(0).double_value ();
  2602. !       if (! error_state)
  2603. !     {
  2604. !       if (D_NINT (d_old) == d_old)
  2605. !         {
  2606. !           int i_old = NINT (d_old);
  2607. !           // XXX FIXME XXX -- are these checks sufficient?
  2608. !           if (i_old >= 0)
  2609. !         {
  2610. !           int status = dup (i_old);
  2611. !           retval(0) = (double) status;
  2612. !           if (status < 0)
  2613. !             retval(1) = strerror (errno);
  2614. !         }
  2615. !           else
  2616. !         error ("_dup: invalid file id");
  2617. !         }
  2618. !       else
  2619. !         error ("_dup: argument must be integer value");
  2620. !     }
  2621. ! #else
  2622. !       gripe_not_supported ("_dup");
  2623. ! #endif
  2624. !     }
  2625. !   else
  2626. !     print_usage ("_dup");
  2627. !   return retval;
  2628. ! }
  2629. ! DEFUN (_dup2, args, ,
  2630. !  "[FID, MSG] = _dup2 (OLD, NEW)\n\
  2631.   \n\
  2632.   Duplicate a file descriptor.\n\
  2633.   \n\
  2634. ***************
  2635. *** 126,142 ****
  2636.               retval(1) = strerror (errno);
  2637.           }
  2638.             else
  2639. !         error ("dup2: invalid file id");
  2640.           }
  2641.         else
  2642. !         error ("dup2: arguments must be integer values");
  2643.       }
  2644.   #else
  2645. !       gripe_not_supported ("dup2");
  2646.   #endif
  2647.       }
  2648.     else
  2649. !     print_usage ("dup2");
  2650.   
  2651.     return retval;
  2652.   }
  2653. --- 180,393 ----
  2654.               retval(1) = strerror (errno);
  2655.           }
  2656.             else
  2657. !         error ("_dup2: invalid file id");
  2658. !         }
  2659. !       else
  2660. !         error ("_dup2: arguments must be integer values");
  2661. !     }
  2662. ! #else
  2663. !       gripe_not_supported ("_dup2");
  2664. ! #endif
  2665. !     }
  2666. !   else
  2667. !     print_usage ("_dup2");
  2668. !   return retval;
  2669. ! }
  2670. ! DEFUN (_close, args, ,
  2671. !  "[RETVAL, MSG] = _close (fid): close a file handle")
  2672. ! {
  2673. !   octave_value_list retval;
  2674. !   retval(1) = string ();
  2675. !   retval(0) = -1.0;
  2676. !   int nargin = args.length ();
  2677. !   if (nargin == 1)
  2678. !     {
  2679. !       double d_old = args(0).double_value ();
  2680. !       if (! error_state)
  2681. !     {
  2682. !       if (D_NINT (d_old) == d_old)
  2683. !         {
  2684. !           int i_old = NINT (d_old);
  2685. !           // XXX FIXME XXX -- are these checks sufficient?
  2686. !           if (i_old >= 0)
  2687. !         {
  2688. !           int status = close (i_old);
  2689. !           retval(0) = (double) status;
  2690. !           if (status < 0)
  2691. !             retval(1) = strerror (errno);
  2692. !         }
  2693. !           else
  2694. !         error ("_close: invalid file id");
  2695. !         }
  2696. !       else
  2697. !         error ("_close: argument must be integer value");
  2698. !     }
  2699. !     }
  2700. !   else
  2701. !     print_usage ("_close");
  2702. !   return retval;
  2703. ! }
  2704. ! DEFUN (_fdopen, args, ,
  2705. !  "[FID, MSG] = _fdopen (fid, mode): create a stream for file handle")
  2706. ! {
  2707. !   octave_value_list retval;
  2708. !   retval(1) = string ();
  2709. !   retval(0) = -1.0;
  2710. !   int nargin = args.length ();
  2711. !   if (nargin == 2)
  2712. !     {
  2713. !       if (args(1).is_string ())
  2714. !     {
  2715. !       string mode = args(1).string_value ();
  2716. !       double d_old = args(0).double_value ();
  2717. !       if (! error_state)
  2718. !         {
  2719. !           if (D_NINT (d_old) == d_old)
  2720. !         {
  2721. !           int i_old = NINT (d_old);
  2722. !           // XXX FIXME XXX -- are these checks sufficient?
  2723. !           if (i_old >= 0)
  2724. !             {
  2725. !               if (mode == "r")
  2726. !             {
  2727. !               FILE *f = fdopen (i_old, "r");
  2728. !               octave_istdiostream *is
  2729. !                 = new octave_istdiostream ("fdopen", f);
  2730. !               retval(0) = octave_stream_list::insert (is);
  2731. !             }
  2732. !               else if (mode == "w")
  2733. !             {
  2734. !               FILE *f = fdopen (i_old, "w");
  2735. !               octave_ostdiostream *os
  2736. !                 = new octave_ostdiostream ("fdopen", f);
  2737. !               retval(0) = octave_stream_list::insert (os);
  2738. !             }
  2739. !               else
  2740. !             error ("_fdopen: invalid mode");
  2741. !             }
  2742. !           else
  2743. !             error ("_fdopen: invalid file id");
  2744. !         }
  2745. !           else
  2746. !         error ("_fdopen: argument must be integer value");
  2747. !         }
  2748. !     }
  2749. !       else
  2750. !     error ("_fdopen: mode must be a string");
  2751.       }
  2752.     else
  2753. !     print_usage ("_fdopen");
  2754. !   return retval;
  2755. ! }
  2756. ! DEFUN (spawn, args, ,
  2757. !  "[STATUS, MSG] = spawn (mode, file, args): run a program")
  2758. ! {
  2759. !   octave_value_list retval;
  2760. !   retval(1) = string ();
  2761. !   retval(0) = -1.0;
  2762. !   int nargin = args.length ();
  2763. !   if (nargin == 2 || nargin == 3)
  2764. !     {
  2765. ! #if defined (HAVE_SPAWNVP)
  2766. !       string mode_strg = args(0).string_value ();
  2767. !       string exec_file = args(1).string_value ();
  2768. !       int mode = P_WAIT;
  2769. !       if (mode_strg == "wait")
  2770. !     mode = P_WAIT;
  2771. !       else if (mode_strg == "nowait")
  2772. !     mode = P_NOWAIT;
  2773. !       else if (mode_strg == "detach")
  2774. !     mode = P_DETACH;
  2775. !       else if (mode_strg == "session")
  2776. !     mode = P_SESSION;
  2777. !       else if (mode_strg == "pm")
  2778. !     mode = P_PM;
  2779. !       else
  2780. !     error ("system: invalid mode specified.");
  2781. !       if (! error_state)
  2782. !     {
  2783. !       char **exec_args = 0;
  2784. !       if (nargin == 3)
  2785. !         {
  2786. !           charMatrix chm = args(2).all_strings ();
  2787. !           if (! error_state)
  2788. !         {
  2789. !           int nr = chm.rows ();
  2790. !           int nc = chm.cols ();
  2791. !           exec_args = new char * [nr+2];
  2792. !           // XXX FIXME XXX -- potential leak?
  2793. !           exec_args[0] = strsave (exec_file.c_str ());
  2794. !           exec_args[nr+1] = 0;
  2795. !           for (int i = 0; i < nr; i++)
  2796. !             {
  2797. !               exec_args[i+1] = new char [nc+1];
  2798. !               for (int j = 0; j < nc; j++)
  2799. !             exec_args[i+1][j] = chm (i, j);
  2800. !               exec_args[i+1][nc] = '\0';
  2801. !             }
  2802. !         }
  2803. !           else
  2804. !         error ("spawn: arguments must be strings");
  2805. !         }
  2806. !       else
  2807. !         {
  2808. !           exec_args = new char * [2];
  2809. !           exec_args[0] = strsave (exec_file.c_str ());
  2810. !           exec_args[1] = 0;
  2811.           }
  2812. +       if (! error_state)
  2813. +         {
  2814. +           int status = spawnvp (mode, exec_file.c_str (), exec_args);
  2815. +           retval(0) = (double) status;
  2816. +           if (status < 0)
  2817. +         retval(1) = strerror (errno);
  2818. +         }
  2819. +     }
  2820. +       else
  2821. +     error ("spawn: first two arguments must be strings");
  2822.   #else
  2823. !       gripe_not_supported ("spawn");
  2824.   #endif
  2825.       }
  2826.     else
  2827. !     print_usage ("spawn");
  2828.   
  2829.     return retval;
  2830.   }
  2831. ***************
  2832. *** 224,231 ****
  2833.     return retval;
  2834.   }
  2835.   
  2836. ! DEFUN (fcntl, args, ,
  2837. !  "[STATUS, MSG] = fcntl (FID, REQUEST, ARGUMENT)\n\
  2838.   \n\
  2839.   Control open file descriptors.\n\
  2840.   \n\
  2841. --- 475,482 ----
  2842.     return retval;
  2843.   }
  2844.   
  2845. ! DEFUN (_fcntl, args, ,
  2846. !  "[STATUS, MSG] = _fcntl (FID, REQUEST, ARGUMENT)\n\
  2847.   \n\
  2848.   Control open file descriptors.\n\
  2849.   \n\
  2850. ***************
  2851. *** 516,521 ****
  2852. --- 767,773 ----
  2853.   
  2854.     if (nargin == 2)
  2855.       {
  2856. + #if defined (HAVE_MKFIFO)
  2857.         if (args(0).is_string ())
  2858.       {
  2859.         string name = args(0).string_value ();
  2860. ***************
  2861. *** 538,544 ****
  2862.       }
  2863.         else
  2864.       error ("mkfifo: file name must be a string");
  2865.       }
  2866.     else
  2867.       print_usage ("mkfifo");
  2868. --- 790,798 ----
  2869.       }
  2870.         else
  2871.       error ("mkfifo: file name must be a string");
  2872. ! #else
  2873. !       gripe_not_supported ("mkfifo");
  2874. ! #endif
  2875.       }
  2876.     else
  2877.       print_usage ("mkfifo");
  2878. ***************
  2879. *** 546,551 ****
  2880. --- 800,852 ----
  2881.     return retval;
  2882.   }
  2883.   
  2884. + DEFUN (_pipe, args, ,
  2885. +   "[FIDS, STATUS, MSG] = _pipe (): create an interprocess channel.\n\
  2886. + \n\
  2887. + Return the FIDS corresponding to the reading and writing ends of\n\
  2888. + the pipe, as a vector.\n\
  2889. + \n\
  2890. + You must open the FIDS using _fdopen!\n\
  2891. + \n\
  2892. + If successful, STATUS is 0 and MSG is an empty string.  Otherwise,\n\
  2893. + STATUS is nonzero and MSG contains a system-dependent error message.")
  2894. + {
  2895. +   octave_value_list retval;
  2896. +   retval(2) = string ();
  2897. +   retval(1) = -1.0;
  2898. +   retval(0) = Matrix ();
  2899. +   int nargin = args.length ();
  2900. +   if (nargin == 0)
  2901. +     {
  2902. + #if defined (HAVE_PIPE)
  2903. +       int fid[2];
  2904. +       int status = pipe (fid);
  2905. +       if (status < 0)  retval(2) = strerror (errno);
  2906. +       else
  2907. +     {
  2908. +       Matrix file_ids (1, 2);
  2909. +       file_ids (0, 0) = (double) fid[0];
  2910. +       file_ids (0, 1) = (double) fid[1];
  2911. +           retval(0) = file_ids;
  2912. +       retval(1) = (double) status;
  2913. +     }      
  2914. + #else
  2915. +       gripe_not_supported ("_pipe");
  2916. + #endif
  2917. +     }
  2918. +   else
  2919. +     print_usage ("_pipe");
  2920. +   return retval;
  2921. + }
  2922.   DEFUN (pipe, args, ,
  2923.     "[FILE_IDS, STATUS, MSG] = pipe (): create an interprocess channel.\n\
  2924.   \n\
  2925. ***************
  2926. *** 766,773 ****
  2927.   
  2928.             if (! error_state)
  2929.           {
  2930. !           pid_t status = waitpid (pid, 0, options);
  2931.   
  2932.             retval(0) = (double) status;
  2933.   
  2934.             if (status < 0)
  2935. --- 1067,1084 ----
  2936.   
  2937.             if (! error_state)
  2938.           {
  2939. ! #ifdef __EMX__
  2940. !           volatile octave_interrupt_handler saved_interrupt_handler
  2941. !             = octave_ignore_interrupts ();
  2942.   
  2943. +           volatile sig_handler *saved_sigchld_handler
  2944. +             = octave_set_signal_handler (SIGCHLD, SIG_IGN);
  2945. + #endif
  2946. +           pid_t status = waitpid (pid, 0, options);
  2947. + #ifdef __EMX__
  2948. +           octave_set_interrupt_handler (saved_interrupt_handler);
  2949. +           octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
  2950. + #endif
  2951.             retval(0) = (double) status;
  2952.   
  2953.             if (status < 0)
  2954. diff -cwr g:/project/C/octave-2.09.orig/src/sysdep.cc g:/project/C/octave-2.09/src/sysdep.cc
  2955. *** g:/project/C/octave-2.09.orig/src/sysdep.cc    Thu Jul 10 15:57:24 1997
  2956. --- g:/project/C/octave-2.09/src/sysdep.cc    Thu Jul 10 16:23:40 1997
  2957. ***************
  2958. *** 28,33 ****
  2959. --- 28,35 ----
  2960.   
  2961.   */
  2962.   
  2963. + /* Modified by Klaus Gebhardt, 1996 */
  2964.   #ifdef HAVE_CONFIG_H
  2965.   #include <config.h>
  2966.   #endif
  2967. ***************
  2968. *** 59,64 ****
  2969. --- 61,71 ----
  2970.   LOSE! LOSE!
  2971.   #endif
  2972.   
  2973. + #ifdef __EMX__
  2974. + #include <float.h>
  2975. + #include <sys/uflags.h>
  2976. + #endif
  2977.   #if defined (HAVE_FLOATINGPOINT_H)
  2978.   #include <floatingpoint.h>
  2979.   #endif
  2980. ***************
  2981. *** 71,83 ****
  2982.   #include <sys/utsname.h>
  2983.   #endif
  2984.   
  2985.   #if defined (USE_READLINE)
  2986.   #include <readline/readline.h>
  2987.   #include <readline/tilde.h>
  2988.   #endif
  2989.   extern char *term_clrpag;
  2990.   extern "C" void _rl_output_character_function ();
  2991.   
  2992.   #include "mach-info.h"
  2993.   #include "oct-math.h"
  2994. --- 78,101 ----
  2995.   #include <sys/utsname.h>
  2996.   #endif
  2997.   
  2998. + #ifndef __EMX__
  2999.   #if defined (USE_READLINE)
  3000.   #include <readline/readline.h>
  3001.   #include <readline/tilde.h>
  3002.   #endif
  3003.   extern char *term_clrpag;
  3004.   extern "C" void _rl_output_character_function ();
  3005. + #else
  3006. + #include <readline/readline.h>
  3007. + #include <readline/tilde.h>
  3008. + #include <sys/ioctl.h>
  3009. + extern "C"
  3010. + {
  3011. +   extern void tputs ();
  3012. +   extern char *term_clrpag;
  3013. +   extern void _rl_output_character_function ();
  3014. + }
  3015. + #endif
  3016.   
  3017.   #include "mach-info.h"
  3018.   #include "oct-math.h"
  3019. ***************
  3020. *** 88,93 ****
  3021. --- 106,112 ----
  3022.   #include "input.h"
  3023.   #include "mappers.h"
  3024.   #include "oct-obj.h"
  3025. + #include "pager.h"
  3026.   #include "pathlen.h"
  3027.   #include "ov.h"
  3028.   #include "sysdep.h"
  3029. ***************
  3030. *** 139,144 ****
  3031. --- 158,165 ----
  3032.   {
  3033.     _control87 ((EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW
  3034.              | EM_UNDERFLOW | EM_INEXACT), MCW_EM);
  3035. +   _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
  3036.   }
  3037.   #endif
  3038.   
  3039. ***************
  3040. *** 325,330 ****
  3041. --- 346,352 ----
  3042.   kbhit (void)
  3043.   {
  3044.     int c;
  3045. +   flush_octave_stdout ();
  3046.     raw_mode (1);
  3047.     c = cin.get ();
  3048.     raw_mode (0);
  3049. ***************
  3050. *** 469,475 ****
  3051.   
  3052.     // XXX FIXME XXX -- add timeout and default value args?
  3053.   
  3054. !   if (interactive)
  3055.       {
  3056.         int c = kbhit ();
  3057.         char *s = new char [2];
  3058. --- 491,497 ----
  3059.   
  3060.     // XXX FIXME XXX -- add timeout and default value args?
  3061.   
  3062. !   if (interactive || really_forced_interactive)
  3063.       {
  3064.         int c = kbhit ();
  3065.         char *s = new char [2];
  3066. ***************
  3067. *** 565,570 ****
  3068. --- 587,597 ----
  3069.   
  3070.             if (delay > 0)
  3071.           usleep (delay);
  3072. + #elif defined (HAVE__SLEEP2)
  3073. +           int delay = NINT (dval / 1e3);
  3074. +           if (delay > 0)
  3075. +         _sleep2 (delay);
  3076.   #else
  3077.             int delay = NINT (dval / 1e6);
  3078.   
  3079. ***************
  3080. *** 678,683 ****
  3081. --- 705,731 ----
  3082.   
  3083.   DEFALIAS (EXTPROC, extproc);
  3084.   
  3085. + DEFUN (add_to_command_number, args, ,
  3086. +        "add_to_command_number: add argument to the current command number")
  3087. + {
  3088. +   octave_value_list retval;
  3089. +   int nargin;
  3090. +   if ((nargin = args.length ()) != 1)
  3091. +     {
  3092. +       print_usage ("add_to_command_number");
  3093. +       return retval;
  3094. +     }
  3095. +   double tmp_d = args(0).double_value ();
  3096. +   if (error_state || ((int) tmp_d != tmp_d))
  3097. +     error ("add_to_command_number: expecting integer as argument");
  3098. +   else
  3099. +     current_command_number += (int) tmp_d;
  3100. +   return retval;
  3101. + }
  3102.   #endif
  3103.   
  3104.   /*
  3105. diff -cwr g:/project/C/octave-2.09.orig/src/toplev.cc g:/project/C/octave-2.09/src/toplev.cc
  3106. *** g:/project/C/octave-2.09.orig/src/toplev.cc    Wed Jun 25 14:59:32 1997
  3107. --- g:/project/C/octave-2.09/src/toplev.cc    Wed Jun 25 15:29:44 1997
  3108. ***************
  3109. *** 20,25 ****
  3110. --- 20,27 ----
  3111.   
  3112.   */
  3113.   
  3114. + /* Modified by Klaus Gebhardt, 1996 - 1997 */
  3115.   #ifdef HAVE_CONFIG_H
  3116.   #include <config.h>
  3117.   #endif
  3118. ***************
  3119. *** 77,82 ****
  3120. --- 79,92 ----
  3121.   #include "variables.h"
  3122.   #include <version.h>
  3123.   
  3124. + #ifdef __EMX__
  3125. + extern "C"
  3126. + {
  3127. + #include <process.h>
  3128. +   int _IO_system (const char *, int);
  3129. + }
  3130. + #endif
  3131.   // argv[0] for this program.
  3132.   string Vprogram_invocation_name;
  3133.   
  3134. ***************
  3135. *** 142,147 ****
  3136. --- 152,162 ----
  3137.   void
  3138.   parse_and_execute (FILE *f, int print)
  3139.   {
  3140. +   volatile octave_interrupt_handler old_interrupt_handler
  3141. +     = octave_ignore_interrupts ();
  3142. +   volatile jmp_buf old_toplevel = toplevel;
  3143.     begin_unwind_frame ("parse_and_execute");
  3144.   
  3145.     YY_BUFFER_STATE old_buf = current_buffer ();
  3146. ***************
  3147. *** 160,165 ****
  3148. --- 175,184 ----
  3149.   
  3150.     unwind_protect_ptr (curr_sym_tab);
  3151.   
  3152. +   if (setjmp(toplevel) == 0)
  3153. +     {
  3154. +       octave_set_interrupt_handler (old_interrupt_handler);
  3155.         int retval;
  3156.         do
  3157.       {
  3158. ***************
  3159. *** 196,203 ****
  3160. --- 215,228 ----
  3161.           }
  3162.       }
  3163.         while (retval == 0);
  3164. +     }
  3165. +   else  error ("script executing interrupted ...");
  3166.   
  3167.     run_unwind_frame ("parse_and_execute");
  3168. +   octave_ignore_interrupts ();
  3169. +   toplevel = old_toplevel;
  3170. +   octave_set_interrupt_handler (old_interrupt_handler);
  3171.   }
  3172.   
  3173.   static void
  3174. ***************
  3175. *** 211,216 ****
  3176. --- 236,244 ----
  3177.   parse_and_execute (const string& s, int print, int verbose,
  3178.              const char *warn_for)
  3179.   {
  3180. +   volatile octave_interrupt_handler old_interrupt_handler
  3181. +     = octave_ignore_interrupts ();
  3182.     begin_unwind_frame ("parse_and_execute_2");
  3183.   
  3184.     unwind_protect_int (reading_script_file);
  3185. ***************
  3186. *** 247,252 ****
  3187. --- 275,282 ----
  3188.       error ("%s: unable to open file `%s'", warn_for, s.c_str ());
  3189.   
  3190.     run_unwind_frame ("parse_and_execute_2");
  3191. +   octave_set_interrupt_handler (old_interrupt_handler);
  3192.   }
  3193.   
  3194.   int
  3195. ***************
  3196. *** 258,263 ****
  3197. --- 288,297 ----
  3198.   
  3199.     if (setjmp (toplevel) != 0)
  3200.       {
  3201. + #if defined (__EMX__) && defined (OS2)
  3202. +       run_all_unwind_protects ();
  3203. + #endif
  3204.         raw_mode (0);
  3205.   
  3206.         cout << "\n";
  3207. ***************
  3208. *** 274,279 ****
  3209. --- 308,318 ----
  3210.     int retval;
  3211.     do
  3212.       {
  3213. + #ifdef __EMX__
  3214. +       can_interrupt = 1;
  3215. +       octave_catch_interrupts ();
  3216. + #endif
  3217.         curr_sym_tab = top_level_sym_tab;
  3218.   
  3219.         reset_parser ();
  3220. ***************
  3221. *** 288,294 ****
  3222.   
  3223.         global_command = 0;
  3224.   
  3225. !       if (! (interactive || forced_interactive))
  3226.           {
  3227.             bool quit = (returning || breaking);
  3228.   
  3229. --- 327,334 ----
  3230.   
  3231.         global_command = 0;
  3232.   
  3233. !       if (! (interactive || forced_interactive
  3234. !          || really_forced_interactive))
  3235.           {
  3236.             bool quit = (returning || breaking);
  3237.   
  3238. ***************
  3239. *** 304,310 ****
  3240.   
  3241.         if (error_state)
  3242.           {
  3243. !           if (! (interactive || forced_interactive))
  3244.           break;
  3245.           }
  3246.         else
  3247. --- 344,351 ----
  3248.   
  3249.         if (error_state)
  3250.           {
  3251. !           if (! (interactive || forced_interactive
  3252. !              || really_forced_interactive))
  3253.           break;
  3254.           }
  3255.           else
  3256. ***************
  3257. *** 372,383 ****
  3258.   
  3259.     cleanup_tmp_files ();
  3260.   
  3261. !   if (!quitting_gracefully && (interactive || forced_interactive))
  3262.       cout << "\n";
  3263.   
  3264.     if (retval == EOF)
  3265.       retval = 0;
  3266.   
  3267.     exit (retval);
  3268.   
  3269.     // This is bogus but should prevent g++ from giving a warning saying
  3270. --- 413,429 ----
  3271.   
  3272.     cleanup_tmp_files ();
  3273.   
  3274. !   if (!quitting_gracefully &&
  3275. !       (interactive || forced_interactive || really_forced_interactive))
  3276.       cout << "\n";
  3277.   
  3278.     if (retval == EOF)
  3279.       retval = 0;
  3280.   
  3281. + #if defined (__EMX__)
  3282. +   _sleep2 (500);
  3283. + #endif
  3284.     exit (retval);
  3285.   
  3286.     // This is bogus but should prevent g++ from giving a warning saying
  3287. ***************
  3288. *** 582,588 ****
  3289.   
  3290.     octave_value_list tmp = eval_string (s, print, parse_status, 1);
  3291.   
  3292. -   if (tmp.length () > 0)
  3293.       retval = tmp(0);
  3294.   
  3295.     return retval;
  3296. --- 628,633 ----
  3297. ***************
  3298. *** 762,768 ****
  3299. --- 807,817 ----
  3300.   
  3301.         string cmd_str = args(0).string_value ();
  3302.   
  3303. + #if defined (__EMX__) && defined (OS2)
  3304. +       enum exec_type { sync, async, pm };
  3305. + #else
  3306.         enum exec_type { sync, async };
  3307. + #endif
  3308.   
  3309.         exec_type type = sync;
  3310.   
  3311. ***************
  3312. *** 778,785 ****
  3313. --- 827,842 ----
  3314.               type = sync;
  3315.             else if (type_str == "async")
  3316.               type = async;
  3317. + #if defined (__EMX__) && defined (OS2)
  3318. +           else if (type_str == "pm")
  3319. +             type = pm;
  3320. +           else
  3321. +             error ("system: third arg must be \"sync\" , \"async\""
  3322. +                "or \"pm\"");
  3323. + #else
  3324.             else
  3325.               error ("system: third arg must be \"sync\" or \"async\"");
  3326. + #endif
  3327.           }
  3328.             else
  3329.           error ("system: third argument must be a string");
  3330. ***************
  3331. *** 790,797 ****
  3332. --- 847,859 ----
  3333.   
  3334.         if (! error_state)
  3335.       {
  3336. + #if defined (__EMX__) && defined (OS2)
  3337. +       if (type == async || type == pm)
  3338. + #else
  3339.         if (type == async)
  3340. + #endif
  3341.           {
  3342. + #ifndef __EMX__
  3343.             pid_t pid = fork ();
  3344.   
  3345.             if (pid < 0) 
  3346. ***************
  3347. *** 804,815 ****
  3348. --- 866,897 ----
  3349.           }
  3350.             else
  3351.           retval(0) = (double) pid;
  3352. + #else
  3353. +           pid_t pid;
  3354. +           int p_mode;
  3355. + #ifdef OS2
  3356. +           if (type == pm)  p_mode = P_PM;
  3357. +           else             p_mode = P_NOWAIT;
  3358. + #else
  3359. +           p_mode = P_NOWAIT;
  3360. + #endif
  3361. +           pid = _IO_system (cmd_str.c_str (), p_mode);
  3362. +           if (pid < 0)
  3363. +         error ("system: spawn failed -- can't create child process");
  3364. +           else
  3365. +         retval(0) = (double) pid;
  3366. + #endif
  3367.           }
  3368.         else if (return_output)
  3369.           retval = run_command_and_return_output (cmd_str);
  3370.         else
  3371.           {
  3372. + #ifdef __EMX__
  3373. +            int status = _IO_system (cmd_str.c_str (), P_WAIT);
  3374. + #else
  3375.             int status = system (cmd_str.c_str ());
  3376. + #endif
  3377.   
  3378.             // The value in status is as returned by waitpid.  If
  3379.             // the process exited normally, extract the actual exit
  3380. ***************
  3381. *** 831,839 ****
  3382.   
  3383.   DEFALIAS (shell_cmd, system);
  3384.   
  3385. ! // XXX FIXME XXX -- this should really be static, but that causes
  3386. ! // problems on some systems.
  3387. ! SLStack<string> octave_atexit_functions;
  3388.   
  3389.   void
  3390.   do_octave_atexit (void)
  3391. --- 913,919 ----
  3392.   
  3393.   DEFALIAS (shell_cmd, system);
  3394.   
  3395. ! static SLStack<string> octave_atexit_functions;
  3396.   
  3397.   void
  3398.   do_octave_atexit (void)
  3399. diff -cwr g:/project/C/octave-2.09.orig/src/utils.cc g:/project/C/octave-2.09/src/utils.cc
  3400. *** g:/project/C/octave-2.09.orig/src/utils.cc    Thu Jul 10 15:57:24 1997
  3401. --- g:/project/C/octave-2.09/src/utils.cc    Thu Jul 10 16:23:40 1997
  3402. ***************
  3403. *** 20,25 ****
  3404. --- 20,27 ----
  3405.   
  3406.   */
  3407.   
  3408. + /* Modified by Klaus Gebhardt, 1996 */
  3409.   #ifdef HAVE_CONFIG_H
  3410.   #include <config.h>
  3411.   #endif
  3412. ***************
  3413. *** 102,108 ****
  3414. --- 104,112 ----
  3415.   extern "C" void
  3416.   jump_to_top_level (void)
  3417.   {
  3418. + #if ! defined (__EMX__) || ! defined (OS2)
  3419.     run_all_unwind_protects ();
  3420. + #endif
  3421.   
  3422.     longjmp (toplevel, 1);
  3423.   }
  3424. diff -cwr g:/project/C/octave-2.09.orig/src/variables.cc g:/project/C/octave-2.09/src/variables.cc
  3425. *** g:/project/C/octave-2.09.orig/src/variables.cc    Wed May 28 03:39:32 1997
  3426. --- g:/project/C/octave-2.09/src/variables.cc    Mon May 26 18:24:16 1997
  3427. ***************
  3428. *** 20,25 ****
  3429. --- 20,27 ----
  3430.   
  3431.   */
  3432.   
  3433. + /* Modified by Klaus Gebhardt, 1996 */
  3434.   #ifdef HAVE_CONFIG_H
  3435.   #include <config.h>
  3436.   #endif
  3437. ***************
  3438. *** 487,496 ****
  3439.         if (! have_help_text)
  3440.           {
  3441.             first_comments_seen = true;
  3442. !           help_txt += (char) c;
  3443.           }
  3444.   
  3445. !       if (c == '\n')
  3446.           {
  3447.             if (update_pos)
  3448.           {
  3449. --- 489,510 ----
  3450.         if (! have_help_text)
  3451.           {
  3452.             first_comments_seen = true;
  3453. !           if (c == '\r')
  3454. !         {
  3455. !           int d = getc (ffile);
  3456. !           if (c != '\n' && c != '\r' && c != '')
  3457. !             help_txt += (char) '\n';
  3458. ! #if defined (EMX09C)
  3459. !           fseek (ffile, -1l, SEEK_CUR);
  3460. ! #else
  3461. !           ungetc (d, ffile);
  3462. ! #endif
  3463. !         }
  3464. !           else if (c == '')  help_txt += (char) '\n';
  3465. !           else                 help_txt += (char) c;
  3466.           }
  3467.   
  3468. !       if (c == '\n' || c == '')
  3469.           {
  3470.             if (update_pos)
  3471.           {
  3472. ***************
  3473. *** 505,512 ****
  3474.               {
  3475.                 if (update_pos)
  3476.               current_input_column--;
  3477.                 ungetc (c, ffile);
  3478. !               if (c == '\n')
  3479.               break;
  3480.               }
  3481.             else
  3482. --- 519,530 ----
  3483.               {
  3484.                 if (update_pos)
  3485.               current_input_column--;
  3486. + #if defined (EMX09C)
  3487. +               fseek (ffile, -1l, SEEK_CUR);
  3488. + #else
  3489.                 ungetc (c, ffile);
  3490. ! #endif
  3491. !               if (c == '\n' || c == '\r' || c == '')
  3492.               break;
  3493.               }
  3494.             else
  3495. ***************
  3496. *** 524,529 ****
  3497. --- 542,553 ----
  3498.           have_help_text = true;
  3499.             break;
  3500.   
  3501. +         case '\r':
  3502. +           if (first_comments_seen)  have_help_text = true;
  3503. +           if (update_pos)           current_input_column = 0;
  3504. +           continue;
  3505. +         case '':
  3506.           case '\n':
  3507.             if (first_comments_seen)
  3508.           have_help_text = true;
  3509. ***************
  3510. *** 543,549 ****
  3511. --- 567,577 ----
  3512.           default:
  3513.             if (update_pos)
  3514.           current_input_column--;
  3515. + #if defined (EMX09C)
  3516. +           fseek (ffile, -1l, SEEK_CUR);
  3517. + #else
  3518.             ungetc (c, ffile);
  3519. + #endif
  3520.             goto done;
  3521.           }
  3522.       }
  3523. ***************
  3524. *** 791,797 ****
  3525.   
  3526.     if (! path.empty ())
  3527.       {
  3528. !       FILE *fptr = fopen (path.c_str (), "r");
  3529.   
  3530.         if (fptr)
  3531.       {
  3532. --- 819,825 ----
  3533.   
  3534.     if (! path.empty ())
  3535.       {
  3536. !       FILE *fptr = fopen (path.c_str (), "rb");
  3537.   
  3538.         if (fptr)
  3539.       {
  3540. diff -cwr g:/project/C/octave-2.09.orig/src/version.h g:/project/C/octave-2.09/src/version.h
  3541. *** g:/project/C/octave-2.09.orig/src/version.h    Thu Jul 10 15:57:24 1997
  3542. --- g:/project/C/octave-2.09/src/version.h    Fri Jul 18 01:22:28 1997
  3543. ***************
  3544. *** 20,25 ****
  3545. --- 20,47 ----
  3546.   
  3547.   */
  3548.   
  3549. + /* Modified by Klaus Gebhardt, 1996 */
  3550. + #if defined (__EMX__) && defined (OS2)
  3551. + #define OCTAVE_VERSION "2.0.9"
  3552. + #define OCTAVE_OS2_PATCHLEVEL "2.09-b03"
  3553. + #define OCTAVE_COPYRIGHT \
  3554. + "Copyright (C) 1996, 1997 John W. Eaton.\n\
  3555. + OS/2-Port by Klaus Gebhardt, 1996 - 1997."
  3556. + #define OCTAVE_NAME_AND_VERSION \
  3557. + "Octave " OCTAVE_VERSION " for OS/2 2.x, Warp 3 and Warp 4.\n(Patchlevel " \
  3558. + OCTAVE_OS2_PATCHLEVEL ")"
  3559. + #define OCTAVE_NAME_VERSION_AND_COPYRIGHT \
  3560. +   OCTAVE_NAME_AND_VERSION ".\n" OCTAVE_COPYRIGHT "\n\
  3561. + This is free software with ABSOLUTELY NO WARRANTY."
  3562. + #define OCTAVE_STARTUP_MESSAGE \
  3563. +   OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\
  3564. + For details, type `warranty'."
  3565. + #else
  3566.   #define OCTAVE_VERSION "2.0.9"
  3567.   
  3568.   #define OCTAVE_COPYRIGHT \
  3569. ***************
  3570. *** 35,41 ****
  3571.   #define OCTAVE_STARTUP_MESSAGE \
  3572.     OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\
  3573.   For details, type `warranty'."
  3574.   /*
  3575.   ;;; Local Variables: ***
  3576.   ;;; mode: C++ ***
  3577. --- 57,63 ----
  3578.   #define OCTAVE_STARTUP_MESSAGE \
  3579.     OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\
  3580.   For details, type `warranty'."
  3581. ! #endif
  3582.   /*
  3583.   ;;; Local Variables: ***
  3584.   ;;; mode: C++ ***
  3585. diff -cwr g:/project/C/octave-2.09.orig/src/y.tab.h g:/project/C/octave-2.09/src/y.tab.h
  3586. *** g:/project/C/octave-2.09.orig/src/y.tab.h    Tue Dec 10 08:54:26 1996
  3587. --- g:/project/C/octave-2.09/src/y.tab.h    Wed Aug 20 18:08:14 1997
  3588. ***************
  3589. *** 21,26 ****
  3590. --- 21,29 ----
  3591.     tree_if_command *tree_if_command_type;
  3592.     tree_if_clause *tree_if_clause_type;
  3593.     tree_if_command_list *tree_if_command_list_type;
  3594. +   tree_switch_command *tree_switch_command_type;
  3595. +   tree_switch_case *tree_switch_case_type;
  3596. +   tree_switch_case_list *tree_switch_case_list_type;
  3597.     tree_global *tree_global_type;
  3598.     tree_global_init_list *tree_global_init_list_type;
  3599.     tree_global_command *tree_global_command_type;
  3600. ***************
  3601. *** 70,98 ****
  3602.   #define    IF    291
  3603.   #define    ELSEIF    292
  3604.   #define    ELSE    293
  3605. ! #define    BREAK    294
  3606. ! #define    CONTINUE    295
  3607. ! #define    FUNC_RET    296
  3608. ! #define    UNWIND    297
  3609. ! #define    CLEANUP    298
  3610. ! #define    TRY    299
  3611. ! #define    CATCH    300
  3612. ! #define    GLOBAL    301
  3613. ! #define    TEXT_ID    302
  3614. ! #define    LEXICAL_ERROR    303
  3615. ! #define    FCN    304
  3616. ! #define    SCREW_TWO    305
  3617. ! #define    ELLIPSIS    306
  3618. ! #define    ALL_VA_ARGS    307
  3619. ! #define    END_OF_INPUT    308
  3620. ! #define    USING    309
  3621. ! #define    TITLE    310
  3622. ! #define    WITH    311
  3623. ! #define    COLON    312
  3624. ! #define    OPEN_BRACE    313
  3625. ! #define    CLOSE_BRACE    314
  3626. ! #define    CLEAR    315
  3627. ! #define    UNARY    316
  3628.   
  3629.   
  3630.   extern YYSTYPE yylval;
  3631. --- 73,104 ----
  3632.   #define    IF    291
  3633.   #define    ELSEIF    292
  3634.   #define    ELSE    293
  3635. ! #define    SWITCH    294
  3636. ! #define    CASE    295
  3637. ! #define    OTHERWISE    296
  3638. ! #define    BREAK    297
  3639. ! #define    CONTINUE    298
  3640. ! #define    FUNC_RET    299
  3641. ! #define    UNWIND    300
  3642. ! #define    CLEANUP    301
  3643. ! #define    TRY    302
  3644. ! #define    CATCH    303
  3645. ! #define    GLOBAL    304
  3646. ! #define    TEXT_ID    305
  3647. ! #define    LEXICAL_ERROR    306
  3648. ! #define    FCN    307
  3649. ! #define    SCREW_TWO    308
  3650. ! #define    ELLIPSIS    309
  3651. ! #define    ALL_VA_ARGS    310
  3652. ! #define    END_OF_INPUT    311
  3653. ! #define    USING    312
  3654. ! #define    TITLE    313
  3655. ! #define    WITH    314
  3656. ! #define    COLON    315
  3657. ! #define    OPEN_BRACE    316
  3658. ! #define    CLOSE_BRACE    317
  3659. ! #define    CLEAR    318
  3660. ! #define    UNARY    319
  3661.   
  3662.   
  3663.   extern YYSTYPE yylval;
  3664. diff -cwr g:/project/C/octave-2.09.orig/scripts/image/image.m g:/project/C/octave-2.09/scripts/image/image.m
  3665. *** g:/project/C/octave-2.09.orig/scripts/image/image.m    Sun Nov  3 06:52:00 1996
  3666. --- g:/project/C/octave-2.09/scripts/image/image.m    Mon Mar 10 00:53:24 1997
  3667. ***************
  3668. *** 19,66 ****
  3669.   
  3670.   ## Display an octave image matrix.
  3671.   ##
  3672. ! ## image (x) displays a matrix as a color image. The elements of x are
  3673.   ## indices into the current colormap and should have values between 1
  3674.   ## and the length of the colormap.
  3675.   ##
  3676. - ## image (x, zoom) changes the zoom factor.  The default value is 4.
  3677. - ##
  3678.   ## SEE ALSO: imshow, imagesc, colormap.
  3679.   
  3680.   ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  3681.   ## Created: July 1994
  3682.   ## Adapted-By: jwe
  3683.   
  3684.   function image (x, zoom)
  3685.   
  3686.     if (nargin == 0)
  3687.       ## Load Bobbie Jo Richardson (Born 3/16/94)
  3688. !     x = loadimage ("default.img");
  3689. !     zoom = 2;
  3690.     elseif (nargin == 1)
  3691. !     zoom = 4;
  3692.     elseif (nargin > 2)
  3693.       usage ("image (matrix, [zoom])");
  3694.     endif
  3695.   
  3696. !   ppm_name = tmpnam ();
  3697. !   saveimage (ppm_name, x, "ppm");
  3698. !   ## Start the viewer.  Try xv, then xloadimage.
  3699. !   xv = sprintf ("xv -expand %f %s", zoom, ppm_name);
  3700. !   xloadimage = sprintf ("xloadimage -zoom %f %s", zoom*100, ppm_name);
  3701. !   rm = sprintf ("rm -f %s", ppm_name);
  3702.   
  3703. !   ## Need to let the shell clean up the tmp file because we are putting
  3704. !   ## the viewer in the background.
  3705.   
  3706. !   command = sprintf ("( %s || %s && %s ) > /dev/null 2>&1 &",
  3707. !              xv, xloadimage, rm);
  3708.   
  3709. !   system (command);
  3710.   
  3711.   endfunction
  3712. --- 19,54 ----
  3713.   
  3714.   ## Display an octave image matrix.
  3715.   ##
  3716. ! ## image (x[, map]) displays a matrix as a color image. The elements of x are
  3717.   ## indices into the current colormap and should have values between 1
  3718.   ## and the length of the colormap.
  3719.   ##
  3720.   ## SEE ALSO: imshow, imagesc, colormap.
  3721.   
  3722.   ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  3723.   ## Created: July 1994
  3724.   ## Adapted-By: jwe
  3725. + ## Modified by Klaus Gebhardt, 1996 - 1997
  3726.   
  3727.   function image (x, zoom)
  3728.   
  3729.     if (nargin == 0)
  3730.       ## Load Bobbie Jo Richardson (Born 3/16/94)
  3731. !     [x, map] = loadimage ("default.img");
  3732.     elseif (nargin == 1)
  3733. !     zoom = 1;
  3734.     elseif (nargin > 2)
  3735.       usage ("image (matrix, [zoom])");
  3736.     endif
  3737.   
  3738. !   pnm_name = tmpnam ();
  3739.   
  3740. !   saveimage (pnm_name, x, "pnm");
  3741.   
  3742. !   ## Start the viewer.
  3743. !   i = findstr (pnm_name, "/");
  3744. !   pnm_name (i) = "\\";
  3745.   
  3746. !   system (sprintf ("oct-view %s %f", pnm_name, zoom));
  3747.   
  3748.   endfunction
  3749. diff -cwr g:/project/C/octave-2.09.orig/scripts/image/loadimage.m g:/project/C/octave-2.09/scripts/image/loadimage.m
  3750. *** g:/project/C/octave-2.09.orig/scripts/image/loadimage.m    Wed May 28 03:35:58 1997
  3751. --- g:/project/C/octave-2.09/scripts/image/loadimage.m    Sun Jan 26 02:13:52 1997
  3752. ***************
  3753. *** 1,64 ****
  3754. ! ## Copyright (C) 1996 John W. Eaton
  3755.   ##
  3756. - ## This file is part of Octave.
  3757. - ##
  3758. - ## Octave is free software; you can redistribute it and/or modify it
  3759. - ## under the terms of the GNU General Public License as published by
  3760. - ## the Free Software Foundation; either version 2, or (at your option)
  3761. - ## any later version.
  3762. - ##
  3763. - ## Octave is distributed in the hope that it will be useful, but
  3764. - ## WITHOUT ANY WARRANTY; without even the implied warranty of
  3765. - ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3766. - ## General Public License for more details.
  3767. - ##
  3768. - ## You should have received a copy of the GNU General Public License
  3769. - ## along with Octave; see the file COPYING.  If not, write to the Free
  3770. - ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  3771. - ## 02111-1307, USA.
  3772.   ## Load an image file.
  3773.   ##
  3774. ! ## [img, map] = loadimage (img_file) loads an image and it's associated
  3775. ! ## color map from file img_file.  The image must be in stored in
  3776. ! ## octave's image format.
  3777.   ##
  3778.   ## SEE ALSO: saveimage, load, save
  3779.   
  3780. ! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  3781. ! ## Created: July 1994
  3782. ! ## Adapted-By: jwe
  3783.   
  3784. ! function [img_retval, map_retval] = loadimage (filename)
  3785.   
  3786. !   if (nargin != 1)
  3787. !     usage ("[img, map] = loadimage (filename)");
  3788.     elseif (! isstr (filename))
  3789.       error ("loadimage: expecting filename as a string");
  3790.     endif
  3791.   
  3792. !   file = file_in_path (IMAGEPATH, filename);
  3793. !   if (isempty (file))
  3794. !     error ("loadimage: unable to find image file");
  3795.     endif
  3796.   
  3797. !   ## The file is assumed to have variables img and map, or X and map.
  3798.   
  3799. !   eval (['load ', file]);
  3800.   
  3801. !   if (exist ("img"))
  3802. !     img_retval = img;
  3803. !   elseif (exist ("X"))
  3804. !     img_retval = X;
  3805. !   else
  3806. !     error ("loadimage: invalid image file found");
  3807.     endif
  3808.   
  3809. !   if (exist ("map"))
  3810. !     map_retval = map;
  3811. !   else
  3812. !     error ("loadimage: invalid image file found");
  3813. !   endif
  3814.   
  3815.   endfunction
  3816. --- 1,37 ----
  3817. ! ## Copyright (C) 1996 Klaus Gebhardt
  3818.   ##
  3819.   ## Load an image file.
  3820.   ##
  3821. ! ## [X, map] = loadimage (img_file, fmt) loads an image and its associated
  3822. ! ## color map from file img_file.
  3823.   ##
  3824.   ## SEE ALSO: saveimage, load, save
  3825.   
  3826. ! ## Author: Klaus Gebhardt <gebhardt@crunch.ikp.physik.th-darmstadt.de>
  3827. ! ## Created: November 1996
  3828.   
  3829. ! function [X, map] = loadimage (filename, fmt)
  3830.   
  3831. !   if (nargin != 1 && nargin != 2)
  3832. !     usage ("loadimage (filename[, fmt])");
  3833.     elseif (! isstr (filename))
  3834.       error ("loadimage: expecting filename as a string");
  3835.     endif
  3836.   
  3837. !   if (nargin == 1)
  3838. !     fmt = "img";
  3839.     endif
  3840.   
  3841. !   if (! isstr (fmt))
  3842. !     error ("loadimage: expecting fmt as a string");
  3843. !   endif
  3844.   
  3845. !   file = file_in_path (IMAGEPATH, filename);
  3846.   
  3847. !   if (isempty (file))
  3848. !     error ("loadimage: unable to find image file");
  3849.     endif
  3850.   
  3851. !   eval (sprintf ("[X, map] = %s_dec (file);", fmt));
  3852.   
  3853.   endfunction
  3854. diff -cwr g:/project/C/octave-2.09.orig/scripts/image/saveimage.m g:/project/C/octave-2.09/scripts/image/saveimage.m
  3855. *** g:/project/C/octave-2.09.orig/scripts/image/saveimage.m    Wed May 28 03:35:58 1997
  3856. --- g:/project/C/octave-2.09/scripts/image/saveimage.m    Tue Jan 28 22:59:44 1997
  3857. ***************
  3858. *** 1,101 ****
  3859. ! ## Copyright (C) 1996 John W. Eaton
  3860.   ##
  3861. - ## This file is part of Octave.
  3862. - ##
  3863. - ## Octave is free software; you can redistribute it and/or modify it
  3864. - ## under the terms of the GNU General Public License as published by
  3865. - ## the Free Software Foundation; either version 2, or (at your option)
  3866. - ## any later version.
  3867. - ##
  3868. - ## Octave is distributed in the hope that it will be useful, but
  3869. - ## WITHOUT ANY WARRANTY; without even the implied warranty of
  3870. - ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  3871. - ## General Public License for more details.
  3872. - ##
  3873. - ## You should have received a copy of the GNU General Public License
  3874. - ## along with Octave; see the file COPYING.  If not, write to the Free
  3875. - ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  3876. - ## 02111-1307, USA.
  3877.   ## Save a matrix to disk in image format.
  3878.   ##
  3879. ! ## saveimage (filename, x) saves matrix x to file filename in octave's
  3880.   ## image format.  The current colormap is saved in the file also.
  3881.   ##
  3882. - ## saveimage (filename, x, "img") saves the image in the default format
  3883. - ## and is the same as saveimage (filename, x).
  3884. - ##
  3885. - ## saveimage (filename, x, "ppm") saves the image in ppm format instead
  3886. - ## of the default octave image format.
  3887. - ##
  3888. - ## saveimage (filename, x, "ps") saves the image in PostScript format
  3889. - ## instead of the default octave image format. (Note: images saved in
  3890. - ## PostScript format can not be read back into octave with loadimage.)
  3891. - ##
  3892.   ## saveimage (filename, x, format, map) saves the image along with the
  3893.   ## specified colormap in the specified format.
  3894.   ##
  3895. - ## Note: If the colormap contains only two entries and these entries
  3896. - ## are black and white, the bitmap ppm and PostScript formats are used.
  3897. - ## If the image is a gray scale image (the entries within each row of
  3898. - ## the colormap are equal) the gray scale ppm and PostScript image
  3899. - ## formats are used, otherwise the full color formats are used.
  3900. - ##
  3901. - ## The conversion to PostScript is based on pbmtolps.c, which was
  3902. - ## written by
  3903. - ##
  3904. - ##   George Phillips <phillips@cs.ubc.ca>
  3905. - ##   Department of Computer Science
  3906. - ##   University of British Columbia
  3907. - ##
  3908. - ## and is part of the portable bitmap utilities,
  3909. - ##
  3910. - ## SEE ALSO: loadimage, save, load, colormap
  3911. - ## Author: Tony Richardson <amr@mpl.ucsd.edu>
  3912. - ## Created: July 1994
  3913. - ## Adapted-By: jwe
  3914.   
  3915. ! ## Rewritten by jwe to avoid using octoppm and pbm routines so that
  3916. ! ## people who don't have the the pbm stuff installed can still use this
  3917. ! ## function.
  3918. ! ##
  3919. ! ## The conversion to PostScript is based on pnmtops.c, which is part of
  3920. ! ## the portable bitmap utilties and bears this copyright notice:
  3921. ! ##
  3922. ! ## Copyright (C) 1989 by Jef Poskanzer.
  3923. ! ##
  3924. ! ## Permission to use, copy, modify, and distribute this software and its
  3925. ! ## documentation for any purpose and without fee is hereby granted, provided
  3926. ! ## that the above copyright notice appear in all copies and that both that
  3927. ! ## copyright notice and this permission notice appear in supporting
  3928. ! ## documentation.  This software is provided "as is" without express or
  3929. ! ## implied warranty.
  3930.   
  3931. ! function saveimage (filename, img, img_form, map)
  3932.   
  3933. !   if (nargin < 2 || nargin > 4)
  3934. !     usage ("saveimage (filename, matrix, [format, [colormap]])");
  3935.     endif
  3936.   
  3937.     if (nargin < 4)
  3938.       map = colormap ();
  3939.     endif
  3940.   
  3941. -   [map_nr, map_nc] = size (map);
  3942. -   if (map_nc != 3)
  3943. -     error ("colormap should be an N x 3 matrix");
  3944. -   endif
  3945.     if (nargin < 3)
  3946.       img_form = "img";
  3947.     elseif (! isstr (img_form))
  3948.       error ("image format specification must be a string");
  3949. -   elseif (! (strcmp (img_form, "img")
  3950. -              || strcmp (img_form, "ppm")
  3951. -          || strcmp (img_form, "ps")))
  3952. -     error ("unsupported image format specification");
  3953.     endif
  3954.   
  3955.     if (! is_matrix (img))
  3956. --- 1,31 ----
  3957. ! ## Copyright (C) 1996 Klaus Gebhardt
  3958.   ##
  3959.   ## Save a matrix to disk in image format.
  3960.   ##
  3961. ! ## saveimage (filename, x) saves matrix x to file filename in octaves
  3962.   ## image format.  The current colormap is saved in the file also.
  3963.   ##
  3964.   ## saveimage (filename, x, format, map) saves the image along with the
  3965.   ## specified colormap in the specified format.
  3966.   ##
  3967.   
  3968. ! ## Author: Klaus Gebhardt <gebhardt@crunch.ikp.physik.th-darmstadt.de>
  3969. ! ## Created: November 1996
  3970.   
  3971. ! function saveimage (filename, img, img_form, map, opt)
  3972.   
  3973. !   if (nargin < 2 || nargin > 5)
  3974. !     usage ("saveimage (filename, matrix, [format, [colormap, [opt]]])");
  3975.     endif
  3976.   
  3977.     if (nargin < 4)
  3978.       map = colormap ();
  3979.     endif
  3980.   
  3981.     if (nargin < 3)
  3982.       img_form = "img";
  3983.     elseif (! isstr (img_form))
  3984.       error ("image format specification must be a string");
  3985.     endif
  3986.   
  3987.     if (! is_matrix (img))
  3988. ***************
  3989. *** 106,301 ****
  3990.       error ("file name must be a string");
  3991.     endif
  3992.   
  3993. !   ## If we just want Octave image format, save and return.
  3994. !   if (strcmp (img_form, "img"))
  3995. !     eval (strcat ("save -ascii ", filename, " map img"));
  3996. !     return;
  3997. !   endif
  3998. !   ## Convert to another format if requested.
  3999. !   grey = all (map(:,1) == map(:,2) && map(:,1) == map (:,3));
  4000. !   pbm = pgm = ppm = 0;
  4001. !   map_sz = map_nr * map_nc;
  4002. !   map = reshape (map, map_sz, 1);
  4003. !   idx = find (map > 1);
  4004. !   map (idx) = ones (size (idx));
  4005. !   idx = find (map < 0);
  4006. !   map (idx) = zeros (size (idx));
  4007. !   map = round (255 * map);
  4008. !   bw = (map_nr == 2
  4009. !         && ((map(1,1) == 0 && map(2,1) == 255)
  4010. !             || (map(1,1) == 255 && map(2,1) == 0)));
  4011. !   img = round (img');
  4012. !   [img_nr, img_nc] = size (img);
  4013. !   img_sz = img_nr * img_nc;
  4014. !   img = reshape (img, img_sz, 1);
  4015. !   idx = find (img > map_nr);
  4016. !   img (idx) = ones (size (idx)) * map_nr;
  4017. !   idx = find (img <= 0);
  4018. !   img (idx) = ones (size (idx));
  4019. !   if (strcmp (img_form, "ppm"))
  4020. !     if (grey && map_nr == 2 && bw)
  4021. !       map = map(:,1);
  4022. !       if (map(1) != 0)
  4023. !     map(1) = 1;
  4024. !       else
  4025. !     map(2) = 1;
  4026. !       endif
  4027. !       img = map(img);
  4028. !       n_long = rem (img_sz, 8);
  4029. !       if (n_long == 0)
  4030. !     n_long = 8;
  4031. !       else
  4032. !     n_long++;
  4033. !       endif
  4034. !       idx = 1:8:img_sz;
  4035. !       s_len = length (idx) - 1;
  4036. !       tmp = img (1:8:img_sz) * 128;
  4037. !       for i = 2:n_long
  4038. !     tmp = tmp + img (i:8:img_sz) * 2^(8-i);
  4039. !       endfor
  4040. !       for i = (n_long+1):8
  4041. !     tmp(1:s_len) = tmp(1:s_len) + img (i:8:img_sz) * 2^(8-i);
  4042. !       endfor
  4043. !       fid = fopen (filename, "w");
  4044. !       fprintf (fid, "P4\n%d %d\n", img_nr, img_nc);
  4045. !       fwrite (fid, tmp, "char");
  4046. !       fprintf (fid, "\n");
  4047. !       fclose (fid);
  4048. !     elseif (grey)
  4049. !       fid = fopen (filename, "w");
  4050. !       fprintf (fid, "P5\n%d %d\n255\n", img_nr, img_nc);
  4051. !       fwrite (fid, map(img), "uchar");
  4052. !       fprintf (fid, "\n");
  4053. !       fclose (fid);
  4054. !     else
  4055. !       img_idx = ((1:3:3*img_sz)+2)';
  4056. !       map_idx = ((2*map_nr+1):map_sz)';
  4057. !       tmap = map(map_idx);
  4058. !       tmp(img_idx--) = tmap(img);
  4059. !       map_idx = map_idx - map_nr;
  4060. !       tmap = map(map_idx);
  4061. !       tmp(img_idx--) = tmap(img);
  4062. !       map_idx = map_idx - map_nr;
  4063. !       tmap = map(map_idx);
  4064. !       tmp(img_idx--) = tmap(img);
  4065. !       fid = fopen (filename, "w");
  4066. !       fprintf (fid, "P6\n%d %d\n255\n", img_nr, img_nc);
  4067. !       fwrite (fid, tmp, "uchar");
  4068. !       fprintf (fid, "\n");
  4069. !       fclose (fid);
  4070. !     endif
  4071. !   elseif (strcmp (img_form, "ps") == 1)
  4072. !     if (! grey)
  4073. !       error ("must have a greyscale color map for conversion to PostScript");
  4074. !     endif
  4075. !     bps = 8;
  4076. !     dpi = 300;
  4077. !     pagewid = 612;
  4078. !     pagehgt = 762;
  4079. !     MARGIN = 0.95;
  4080. !     devpix = dpi / 72.0 + 0.5;
  4081. !     pixfac = 72.0 / dpi * devpix;
  4082. !     ## Compute padding to round cols * bps up to the nearest multiple of 8
  4083. !     ## (nr and nc are switched because we transposed the image above).
  4084. !     padright = (((img_nr * bps + 7) / 8) * 8 - img_nr * bps) / bps;
  4085. !     scols = img_nr * pixfac;
  4086. !     srows = img_nc * pixfac;
  4087. !     if (scols > pagewid * MARGIN || srows > pagehgt * MARGIN)
  4088. !       if (scols > pagewid * MARGIN)
  4089. !     scale = scale * (pagewid / scols * MARGIN);
  4090. !     scols = scale * img_nr * pixfac;
  4091. !     srows = scale * img_nc * pixfac;
  4092. !       endif
  4093. !       if (srows > pagehgt * MARGIN)
  4094. !     scale = scale * (pagehgt / srows * MARGIN);
  4095. !     scols = scale * img_nr * pixfac;
  4096. !     srows = scale * img_nc * pixfac;
  4097. !       endif
  4098. !       warning ("image too large for page, rescaling to %g", scale);
  4099. !     endif
  4100. !     llx = (pagewid - scols) / 2;
  4101. !     lly = (pagehgt - srows) / 2;
  4102. !     urx = llx + fix (scols + 0.5);
  4103. !     ury = lly + fix (srows + 0.5);
  4104. !     fid = fopen (filename, "w");
  4105. !     fprintf (fid, "%%!PS-Adobe-2.0 EPSF-2.0\n");
  4106. !     fprintf (fid, "%%%%Creator: Octave %s (saveimage.m)\n", OCTAVE_VERSION);
  4107. !     fprintf (fid, "%%%%Title: %s\n", filename);
  4108. !     fprintf (fid, "%%%%Pages: 1\n");
  4109. !     fprintf (fid, "%%%%BoundingBox: %d %d %d %d\n",
  4110. !              fix (llx), fix (lly), fix (urx), fix (ury));
  4111. !     fprintf (fid, "%%%%EndComments\n" );
  4112. !     fprintf (fid, "/readstring {\n");
  4113. !     fprintf (fid, "  currentfile exch readhexstring pop\n");
  4114. !     fprintf (fid, "} bind def\n");
  4115. !     fprintf (fid, "/picstr %d string def\n",
  4116. !              fix ((img_nr + padright) * bps / 8));
  4117. !     fprintf (fid, "%%%%EndProlog\n");
  4118. !     fprintf (fid, "%%%%Page: 1 1\n");
  4119. !     fprintf (fid, "gsave\n");
  4120. !     fprintf (fid, "%g %g translate\n", llx, lly);
  4121. !     fprintf (fid, "%g %g scale\n", scols, srows);
  4122. !     fprintf (fid, "%d %d %d\n", img_nr, img_nc, bps);
  4123. !     fprintf (fid, "[ %d 0 0 -%d 0 %d ]\n", img_nr, img_nc, img_nc);
  4124. !     fprintf (fid, "{ picstr readstring }\n" );
  4125. !     fprintf (fid, "image\n" );
  4126. !     img = map(img);
  4127. !     fmt = "%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x\n";
  4128. !     fprintf (fid, fmt, img);
  4129. !     if (rem (img_sz, 30) != 0)
  4130. !       fprintf (fid, "\n" );
  4131. !     endif
  4132. !     fprintf (fid, "grestore\n" );
  4133. !     fprintf (fid, "showpage\n" );
  4134. !     fprintf (fid, "%%%%Trailer\n" );
  4135. !     fclose (fid);
  4136.     else
  4137. !     error ("saveimage: what happened to the image type?");
  4138.     endif
  4139.   
  4140.   endfunction
  4141. --- 36,45 ----
  4142.       error ("file name must be a string");
  4143.     endif
  4144.   
  4145. !   if (nargin < 5)
  4146. !     eval (sprintf ("%s_enc (filename, map, img);", img_form));
  4147.     else
  4148. !     eval (sprintf ("%s_enc (filename, map, img, opt);", img_form));
  4149.     endif
  4150.   
  4151.   endfunction
  4152. diff -cwr g:/project/C/octave-2.09.orig/scripts/miscellaneous/bug_report.m g:/project/C/octave-2.09/scripts/miscellaneous/bug_report.m
  4153. *** g:/project/C/octave-2.09.orig/scripts/miscellaneous/bug_report.m    Wed May 28 03:39:24 1997
  4154. --- g:/project/C/octave-2.09/scripts/miscellaneous/bug_report.m    Wed May 28 02:45:10 1997
  4155. ***************
  4156. *** 24,29 ****
  4157. --- 24,30 ----
  4158.   ## you are finished editing.
  4159.   
  4160.   ## Author: jwe
  4161. + ## Modified by Klaus Gebhardt, 1997
  4162.   
  4163.   function bug_report ()
  4164.   
  4165. ***************
  4166. *** 49,55 ****
  4167.         endif
  4168.       endif
  4169.   
  4170. !     cmd = strcat (OCTAVE_HOME, "/bin/octave-bug");
  4171.   
  4172.       if (length (subject) > 0)
  4173.         cmd = sprintf ("%s -s \"%s\"", cmd, subject);
  4174. --- 50,56 ----
  4175.         endif
  4176.       endif
  4177.   
  4178. !     cmd = strcat (OCTAVE_HOME, "/octave-bug");
  4179.   
  4180.       if (length (subject) > 0)
  4181.         cmd = sprintf ("%s -s \"%s\"", cmd, subject);
  4182. diff -cwr g:/project/C/octave-2.09.orig/scripts/miscellaneous/popen2.m g:/project/C/octave-2.09/scripts/miscellaneous/popen2.m
  4183. *** g:/project/C/octave-2.09.orig/scripts/miscellaneous/popen2.m    Mon Jul 15 23:20:20 1996
  4184. --- g:/project/C/octave-2.09/scripts/miscellaneous/popen2.m    Tue May 27 16:11:32 1997
  4185. ***************
  4186. *** 1,4 ****
  4187. ! ## Copyright (C) 1996 John W. Eaton
  4188.   ##
  4189.   ## This file is part of Octave.
  4190.   ##
  4191. --- 1,4 ----
  4192. ! ## Copyright (C) 1997 Klaus Gebhardt
  4193.   ##
  4194.   ## This file is part of Octave.
  4195.   ##
  4196. ***************
  4197. *** 21,28 ****
  4198.   ##
  4199.   ## Start a subprocess with two-way communication.  COMMAND specifies
  4200.   ## the name of the command to start.  ARGS is an array of strings
  4201. ! ## containing options for COMMAND.  IN and out are the file ids of the
  4202. ! ## input and streams for the subprocess, and PID is the process id of
  4203.   ## the subprocess, or -1 if COMMAND could not be executed.
  4204.   ##
  4205.   ## Example:
  4206. --- 21,28 ----
  4207.   ##
  4208.   ## Start a subprocess with two-way communication.  COMMAND specifies
  4209.   ## the name of the command to start.  ARGS is an array of strings
  4210. ! ## containing options for COMMAND.  IN and OUT are the file ids of the
  4211. ! ## input and output streams for the subprocess, and PID is the process id of
  4212.   ## the subprocess, or -1 if COMMAND could not be executed.
  4213.   ##
  4214.   ## Example:
  4215. ***************
  4216. *** 38,44 ****
  4217.   ##  endwhile
  4218.   ##  fclose (out);
  4219.   
  4220. ! ## Author: jwe
  4221.   
  4222.   function [in, out, pid] = popen2 (command, args)
  4223.   
  4224. --- 38,44 ----
  4225.   ##  endwhile
  4226.   ##  fclose (out);
  4227.   
  4228. ! ## Author: Klaus Gebhardt, 1997
  4229.   
  4230.   function [in, out, pid] = popen2 (command, args)
  4231.   
  4232. ***************
  4233. *** 48,98 ****
  4234.   
  4235.     if (nargin == 1 || nargin == 2)
  4236.   
  4237. -     if (nargin == 1)
  4238. -       args = "";
  4239. -     endif
  4240.       if (isstr (command))
  4241.   
  4242. !       [stdin_pipe, stdin_status] = pipe ();
  4243. !       [stdout_pipe, stdout_status] = pipe ();
  4244.   
  4245. !       if (stdin_status == 0 && stdout_status == 0)
  4246.   
  4247. !     pid = fork ();
  4248.   
  4249. !     if (pid == 0)
  4250.   
  4251. !       fclose (stdin_pipe (2));
  4252. !       fclose (stdout_pipe (1));
  4253.   
  4254. !       dup2 (stdin_pipe (1), stdin);
  4255. !       fclose (stdin_pipe (1));
  4256.   
  4257. !       dup2 (stdout_pipe (2), stdout);
  4258. !       fclose (stdout_pipe (2));
  4259.   
  4260. !       if (exec (command, args) < 0)
  4261. !         error ("popen2: unable to start process `%s'", command);
  4262. !         exit (0);
  4263.         endif
  4264.   
  4265. !     elseif (pid)
  4266.   
  4267. !       fclose (stdin_pipe (1));
  4268. !       fclose (stdout_pipe (2));
  4269.   
  4270. -       if (fcntl (stdout_pipe (1), __F_SETFL__, __O_NONBLOCK__) < 0)
  4271. -         error ("popen2: error setting file mode");
  4272.         else
  4273. !         in = stdin_pipe (2);
  4274. !         out = stdout_pipe (1);
  4275.         endif
  4276.   
  4277. !     elseif (pid < 0)
  4278. !       error ("popen2: fork failed -- unable to create child process");
  4279.       endif
  4280. !       else
  4281.       error ("popen2: pipe creation failed");
  4282.         endif
  4283.       else
  4284. --- 48,114 ----
  4285.   
  4286.     if (nargin == 1 || nargin == 2)
  4287.   
  4288.       if (isstr (command))
  4289.   
  4290. !       [r_pipe,  r_status]  = _pipe ();
  4291. !       [w_pipe,  w_status]  = _pipe ();
  4292.   
  4293. !       if ((r_status != -1) && (w_status != -1))
  4294.   
  4295. !     r_parent_end = r_pipe(1);
  4296. !     r_child_end  = r_pipe(2);
  4297. !     _fcntl (r_parent_end, F_SETFD, 1);
  4298. !     r_org = _dup (1);
  4299.   
  4300. !     w_parent_end = w_pipe(2);
  4301. !     w_child_end  = w_pipe(1);
  4302. !     _fcntl (w_parent_end, F_SETFD, 1);
  4303. !     w_org = _dup (0);
  4304.   
  4305. !     if ((r_org != -1) && (w_org != -1))
  4306.   
  4307. !       _dup2 (r_child_end, 1);  _close (r_child_end);  r_child_end = -1;
  4308. !       _dup2 (w_child_end, 0);  _close (w_child_end);  w_child_end = -1;
  4309.   
  4310. !       if (nargin == 1)
  4311. !         pid = spawn ("nowait", command);
  4312. !       else
  4313. !         pid = spawn ("nowait", command, args);
  4314. !       endif
  4315.   
  4316. !       _dup2 (r_org, 1);  _close (r_org);
  4317. !       _dup2 (w_org, 0);  _close (w_org);
  4318. !     endif
  4319. !     if (r_child_end != -1)
  4320. !       _close (r_child_end);
  4321.       endif
  4322.   
  4323. !     if (w_child_end != -1)
  4324. !       _close (w_child_end);
  4325. !     endif
  4326.   
  4327. !     if (pid < 0)
  4328. !       _close (r_parent_end);
  4329. !       _close (w_parent_end);
  4330. !       error ("popen2: unable to start process `%s'", command);
  4331. !     else
  4332. !       out = _fdopen (r_parent_end, "r");
  4333. !       in  = _fdopen (w_parent_end, "w");
  4334. !     endif
  4335.   
  4336.         else
  4337. !     if (r_status != -1)
  4338. !       _close (r_pipe(1));
  4339. !       _close (r_pipe(2));
  4340.       endif
  4341.   
  4342. !     if (wr_status != -1)
  4343. !       _close (w_pipe(1));
  4344. !       _close (w_pipe(2));
  4345.       endif
  4346.       error ("popen2: pipe creation failed");
  4347.         endif
  4348.       else
  4349. diff -cwr g:/project/C/octave-2.09.orig/scripts/plot/sombrero.m g:/project/C/octave-2.09/scripts/plot/sombrero.m
  4350. *** g:/project/C/octave-2.09.orig/scripts/plot/sombrero.m    Wed May 28 03:37:34 1997
  4351. --- g:/project/C/octave-2.09/scripts/plot/sombrero.m    Fri Mar  7 05:02:46 1997
  4352. ***************
  4353. *** 22,28 ****
  4354.   ## Draw a `sombrero' in three dimensions using n grid lines.  The
  4355.   ## function plotted is
  4356.   ##
  4357. ! ##   z = sin (sqrt (x^2 + y^2)) / (sqrt (x^2 + y^2))
  4358.   
  4359.   ## Author: jwe
  4360.   
  4361. --- 22,28 ----
  4362.   ## Draw a `sombrero' in three dimensions using n grid lines.  The
  4363.   ## function plotted is
  4364.   ##
  4365. ! ##   z = sin (x^2 + y^2) / (sqrt (x^2 + y^2))
  4366.   
  4367.   ## Author: jwe
  4368.   
  4369. diff -cwr g:/project/C/octave-2.09.orig/scripts/startup/octaverc g:/project/C/octave-2.09/scripts/startup/octaverc
  4370. *** g:/project/C/octave-2.09.orig/scripts/startup/octaverc    Wed Jul 24 19:05:42 1996
  4371. --- g:/project/C/octave-2.09/scripts/startup/octaverc    Mon May 26 15:54:04 1997
  4372. ***************
  4373. *** 2,4 ****
  4374. --- 2,33 ----
  4375.   ##
  4376.   ## This file should contain any commands that should be executed each
  4377.   ## time Octave starts for every user at this site.
  4378. + ## System-wide startup file
  4379. + ## Octave 2.06 for OS/2
  4380. + ## (c) 1996, Klaus Gebhardt
  4381. + PS1 = "octave:\\#>"
  4382. + EDITOR = "e";
  4383. + if length(getenv("OCTAVE_HOME"))
  4384. +   LOADPATH = sprintf("%s/scripts//", getenv("OCTAVE_HOME"));
  4385. +   INFO_FILE = sprintf("%s/doc/octave", getenv("OCTAVE_HOME"));
  4386. + endif
  4387. + if length(file_in_path(getenv("PATH"),"less.exe"))
  4388. +   PAGER = sprintf("%s -ce",file_in_path(getenv("PATH"),"less.exe"));
  4389. + else
  4390. +   PAGER = "more";
  4391. + endif
  4392. + if length(getenv("GNUPLOT"))
  4393. +   gnuplot_binary = sprintf ("%s/gnuplot.exe", getenv("GNUPLOT"));
  4394. + else
  4395. +   gnuplot_binary = "gnuplot";
  4396. + endif
  4397. + implicit_str_to_num_ok     = 1;
  4398. + ok_to_lose_imaginary_part  = 1;
  4399. + ignore_function_time_stamp = 1;
  4400. diff -cwr g:/project/C/octave-2.09.orig/doc/conf.tex g:/project/C/octave-2.09/doc/conf.tex
  4401. *** g:/project/C/octave-2.09.orig/doc/conf.tex    Wed Aug 13 12:39:44 1997
  4402. --- g:/project/C/octave-2.09/doc/conf.tex    Wed Aug 13 12:27:12 1997
  4403. ***************
  4404. *** 3,7 ****
  4405.   @c For copying conditions, see the file gpl.tex.
  4406.   
  4407.   @set VERSION 2.0.5
  4408. ! @set OCTAVEHOME /usr/local
  4409. ! @set TARGETHOSTTYPE i586-pc-linux-gnu
  4410. --- 3,7 ----
  4411.   @c For copying conditions, see the file gpl.tex.
  4412.   
  4413.   @set VERSION 2.0.5
  4414. ! @set OCTAVEHOME 
  4415. ! @set TARGETHOSTTYPE i486-OS/2
  4416. diff -cwr g:/project/C/octave-2.09.orig/doc/faq/oct-faq.tex g:/project/C/octave-2.09/doc/faq/oct-faq.tex
  4417. *** g:/project/C/octave-2.09.orig/doc/faq/oct-faq.tex    Wed Aug 13 12:39:46 1997
  4418. --- g:/project/C/octave-2.09/doc/faq/oct-faq.tex    Wed Aug 13 12:49:08 1997
  4419. ***************
  4420. *** 1,3 ****
  4421. --- 1,4 ----
  4422. + % Modified by Klaus Gebhardt, 1997
  4423.   \input texinfo.tex      @c -*-texinfo-*-
  4424.   
  4425.   @setfilename oct-faq.
  4426. ***************
  4427. *** 19,24 ****
  4428. --- 20,33 ----
  4429.   @top
  4430.   @unnumbered Preface
  4431.   @cindex FAQ for Octave, latest version
  4432. + @macro email{text}
  4433. + (\text\)
  4434. + @end macro
  4435. + @macro url{text}
  4436. + (\text\)
  4437. + @end macro
  4438.   @end ifinfo
  4439.   
  4440.   This is a list of frequently asked questions (FAQ) for Octave users.
  4441. diff -cwr g:/project/C/octave-2.09.orig/doc/interpreter/control.tex g:/project/C/octave-2.09/doc/interpreter/control.tex
  4442. *** g:/project/C/octave-2.09.orig/doc/interpreter/control.tex    Wed Aug 13 12:39:50 1997
  4443. --- g:/project/C/octave-2.09/doc/interpreter/control.tex    Wed Aug 13 12:27:36 1997
  4444. ***************
  4445. *** 369,374 ****
  4446. --- 369,375 ----
  4447.   @tex
  4448.   $AXA^T - X + B B^T = 0$ or $A^TXA - X + B^TB = 0$,
  4449.   @end tex
  4450. + @end iftex
  4451.   @ifinfo
  4452.   @code{a x a' - x + b b' = 0} or @code{a' x a - x + b' b = 0},
  4453.   @end ifinfo
  4454. diff -cwr g:/project/C/octave-2.09.orig/doc/interpreter/octave.tex g:/project/C/octave-2.09/doc/interpreter/octave.tex
  4455. *** g:/project/C/octave-2.09.orig/doc/interpreter/octave.tex    Wed Aug 13 12:40:04 1997
  4456. --- g:/project/C/octave-2.09/doc/interpreter/octave.tex    Wed Aug 13 12:48:28 1997
  4457. ***************
  4458. *** 1,6 ****
  4459. --- 1,7 ----
  4460.   % Copyright (C) 1996, 1997 John W. Eaton
  4461.   % This is part of the Octave manual.
  4462.   % For copying conditions, see the file gpl.tex.
  4463. + % Modified by Klaus Gebhardt, 1997
  4464.   
  4465.   \input texinfo
  4466.   @setfilename octave.
  4467. ***************
  4468. *** 11,16 ****
  4469. --- 12,25 ----
  4470.   * Octave: (octave).     Interactive language for numerical computations.
  4471.   END-INFO-DIR-ENTRY
  4472.   @end format
  4473. + @macro email{text}
  4474. + (\text\)
  4475. + @end macro
  4476. + @macro url{text}
  4477. + (\text\)
  4478. + @end macro
  4479.   @end ifinfo
  4480.   
  4481.   @c Settings for printing on 8-1/2 by 11 inch paper:
  4482. ***************
  4483. *** 36,42 ****
  4484.   @c This file doesn't include a chapter, so it must not be included
  4485.   @c if you want to run the Emacs function texinfo-multiple-files-update.
  4486.   
  4487. ! @include conf.tex
  4488.   
  4489.   @settitle GNU Octave
  4490.   
  4491. --- 45,51 ----
  4492.   @c This file doesn't include a chapter, so it must not be included
  4493.   @c if you want to run the Emacs function texinfo-multiple-files-update.
  4494.   
  4495. ! @include ../conf.tex
  4496.   
  4497.   @settitle GNU Octave
  4498.   
  4499. diff -cwr g:/project/C/octave-2.09.orig/doc/interpreter/poly.tex g:/project/C/octave-2.09/doc/interpreter/poly.tex
  4500. *** g:/project/C/octave-2.09.orig/doc/interpreter/poly.tex    Wed Aug 13 12:40:06 1997
  4501. --- g:/project/C/octave-2.09/doc/interpreter/poly.tex    Wed Aug 13 12:27:52 1997
  4502. ***************
  4503. *** 8,22 ****
  4504.   In Octave, a polynomial is represented by its coefficients (arranged
  4505.   in descending order).  For example, a vector
  4506.   @iftex
  4507.   @end iftex
  4508.   @ifinfo
  4509. !  $c$
  4510.   @end ifinfo
  4511.   of length
  4512.   @iftex
  4513.   @tex
  4514.    $N+1$
  4515.   @end tex
  4516.   @ifinfo
  4517.    @var{N+1}
  4518.   @end ifinfo
  4519. --- 8,24 ----
  4520.   In Octave, a polynomial is represented by its coefficients (arranged
  4521.   in descending order).  For example, a vector
  4522.   @iftex
  4523. +  $c$
  4524.   @end iftex
  4525.   @ifinfo
  4526. !  @var{c}
  4527.   @end ifinfo
  4528.   of length
  4529.   @iftex
  4530.   @tex
  4531.    $N+1$
  4532.   @end tex
  4533. + @end iftex
  4534.   @ifinfo
  4535.    @var{N+1}
  4536.   @end ifinfo
  4537. diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/array.tex g:/project/C/octave-2.09/doc/liboctave/array.tex
  4538. *** g:/project/C/octave-2.09.orig/doc/liboctave/array.tex    Wed Aug 13 12:40:16 1997
  4539. --- g:/project/C/octave-2.09/doc/liboctave/array.tex    Wed Aug 13 12:28:14 1997
  4540. ***************
  4541. *** 1,4 ****
  4542. ! @node Arrays, Matrix and Vector @var{Operations}, Introduction, Top
  4543.   @chapter Arrays
  4544.   @cindex arrays
  4545.   
  4546. --- 1,4 ----
  4547. ! @node Arrays, Matrix and Vector Operations, Introduction, Top
  4548.   @chapter Arrays
  4549.   @cindex arrays
  4550.   
  4551. diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/factor.tex g:/project/C/octave-2.09/doc/liboctave/factor.tex
  4552. *** g:/project/C/octave-2.09.orig/doc/liboctave/factor.tex    Wed Aug 13 12:40:20 1997
  4553. --- g:/project/C/octave-2.09/doc/liboctave/factor.tex    Wed Aug 13 12:28:18 1997
  4554. ***************
  4555. *** 1,4 ****
  4556. ! @node Matrix Factorizations, Ranges, Matrix and Vector @var{Operations}, Top
  4557.   @chapter Matrix Factorizations
  4558.   @cindex matrix factorizations
  4559.   @cindex factorizations
  4560. --- 1,4 ----
  4561. ! @node Matrix Factorizations, Ranges, Matrix and Vector Operations, Top
  4562.   @chapter Matrix Factorizations
  4563.   @cindex matrix factorizations
  4564.   @cindex factorizations
  4565. diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/gpl.tex g:/project/C/octave-2.09/doc/liboctave/gpl.tex
  4566. *** g:/project/C/octave-2.09.orig/doc/liboctave/gpl.tex    Wed Aug 13 12:40:20 1997
  4567. --- g:/project/C/octave-2.09/doc/liboctave/gpl.tex    Wed Aug 13 12:28:20 1997
  4568. ***************
  4569. *** 1,4 ****
  4570. ! @c Copyright (C) 1996, 1997 John W. Eaton
  4571.   @c This is part of the Octave manual.
  4572.   @c For copying conditions, see the file gpl.tex.
  4573.   
  4574. --- 1,4 ----
  4575. ! @c Copyright (C) 1996 John W. Eaton
  4576.   @c This is part of the Octave manual.
  4577.   @c For copying conditions, see the file gpl.tex.
  4578.   
  4579. diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/liboct.tex g:/project/C/octave-2.09/doc/liboctave/liboct.tex
  4580. *** g:/project/C/octave-2.09.orig/doc/liboctave/liboct.tex    Wed Aug 13 12:40:22 1997
  4581. --- g:/project/C/octave-2.09/doc/liboctave/liboct.tex    Wed Aug 13 12:49:14 1997
  4582. ***************
  4583. *** 1,6 ****
  4584. --- 1,7 ----
  4585.   % Copyright (C) 1996, 1997 John W. Eaton
  4586.   % This is part of the Octave manual.
  4587.   % For copying conditions, see the file gpl.tex.
  4588. + % Modified by Klaus Gebhardt, 1997
  4589.   
  4590.   \input texinfo  @c -*-texinfo-*-
  4591.   @setfilename liboct.
  4592. ***************
  4593. *** 28,39 ****
  4594.   @c This file doesn't include a chapter, so it must not be included
  4595.   @c if you want to run the Emacs function texinfo-multiple-files-update.
  4596.   
  4597. ! @include conf.tex
  4598.   
  4599.   @settitle Octave C++ Classes
  4600.   
  4601.   @ifinfo
  4602.   
  4603.   Copyright (C) 1996, 1997 John W. Eaton.
  4604.   
  4605.   Permission is granted to make and distribute verbatim copies of
  4606. --- 29,48 ----
  4607.   @c This file doesn't include a chapter, so it must not be included
  4608.   @c if you want to run the Emacs function texinfo-multiple-files-update.
  4609.   
  4610. ! @include ../conf.tex
  4611.   
  4612.   @settitle Octave C++ Classes
  4613.   
  4614.   @ifinfo
  4615.   
  4616. + @macro email{text}
  4617. + (\text\)
  4618. + @end macro
  4619. + @macro url{text}
  4620. + (\text\)
  4621. + @end macro
  4622.   Copyright (C) 1996, 1997 John W. Eaton.
  4623.   
  4624.   Permission is granted to make and distribute verbatim copies of
  4625. ***************
  4626. *** 98,104 ****
  4627.   * Copying::                     
  4628.   * Introduction::                
  4629.   * Arrays::                      
  4630. ! * Matrix and Vector @var{Operations}::  
  4631.   * Matrix Factorizations::       
  4632.   * Ranges::                      
  4633.   * Nonlinear Functions::         
  4634. --- 107,113 ----
  4635.   * Copying::                     
  4636.   * Introduction::                
  4637.   * Arrays::                      
  4638. ! * Matrix and Vector Operations::  
  4639.   * Matrix Factorizations::       
  4640.   * Ranges::                      
  4641.   * Nonlinear Functions::         
  4642. diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/matvec.tex g:/project/C/octave-2.09/doc/liboctave/matvec.tex
  4643. *** g:/project/C/octave-2.09.orig/doc/liboctave/matvec.tex    Wed Aug 13 12:40:22 1997
  4644. --- g:/project/C/octave-2.09/doc/liboctave/matvec.tex    Wed Aug 13 12:28:22 1997
  4645. ***************
  4646. *** 107,113 ****
  4647.   
  4648.   @c ------------------------------------------------------------------------
  4649.   
  4650. ! @node Matrix and Vector @var{Operations}, Matrix Factorizations, Arrays, Top
  4651.   @chapter Matrix and Vector Operations
  4652.   @cindex matrix manipulations
  4653.   @cindex vector manipulations
  4654. --- 107,113 ----
  4655.   
  4656.   @c ------------------------------------------------------------------------
  4657.   
  4658. ! @node Matrix and Vector Operations, Matrix Factorizations, Arrays, Top
  4659.   @chapter Matrix and Vector Operations
  4660.   @cindex matrix manipulations
  4661.   @cindex vector manipulations
  4662.